unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Andrew Whatson <whatson@gmail.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guile-devel@gnu.org
Subject: Re: [PATCH v2] Add tests for warning locations.
Date: Thu, 13 Oct 2022 13:18:48 +1000	[thread overview]
Message-ID: <CAPE069d4_F32bWEba2Zj6D4mYA4Yy8LgLT2+wej9P7KmfJz4Bw@mail.gmail.com> (raw)
In-Reply-To: <875ygovkqt.fsf@gnu.org>

Ludovic Courtès <ludo@gnu.org> wrote:
>
> One minor nitpick and then we’re ready to go:
>
> > +   (with-test-prefix "location"
> > +     (define (test-file filename)
> > +       (string-append
> > +        (dirname (current-filename)) "/" filename))
> > +
> > +     (pass-if "unused variable"
> > +       (let ((w (call-with-warnings
> > +                 (lambda ()
> > +                   (compile-file (test-file "tree-il/unused-variable.scm")
> > +                                 #:opts %opts-w-unused
> > +                                 #:to 'cps)))))
> > +         (and (= (length w) 1)
> > +              (number? (string-contains (car w) "unused variable `y'"))
> > +              (number? (string-contains (car w) "tree-il/unused-variable.scm:2:2")))))
>
> Can we avoid the separate files and instead do something like:
>
>   (call-with-input-string "  (foo)"
>     (lambda (port)
>       (set-port-filename! port "test-error-location.scm")
>       (read-and-compile port #:opts … #:to 'cps)))
>
> ?

That cleans things up nicely!  I've sent v3 of the patch incorporating
this change.

Thanks for the review!

Cheers,
Andrew



  parent reply	other threads:[~2022-10-13  3:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-24 13:46 [PATCH] Add tests for warning locations Andrew Whatson
2022-09-24 21:15 ` Maxime Devos
2022-09-24 22:34 ` [PATCH v2] " Andrew Whatson
2022-10-12 20:40   ` Ludovic Courtès
2022-10-13  3:12     ` [PATCH v3] " Andrew Whatson
2022-10-13  3:18     ` Andrew Whatson [this message]
2022-11-29 18:11   ` lloda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAPE069d4_F32bWEba2Zj6D4mYA4Yy8LgLT2+wej9P7KmfJz4Bw@mail.gmail.com \
    --to=whatson@gmail.com \
    --cc=guile-devel@gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).