[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Guile Hacker Handbook - Character sets
From: |
Jérémy Korwin-Zmijowski |
Subject: |
Re: Guile Hacker Handbook - Character sets |
Date: |
Fri, 19 Feb 2021 22:31:48 +0100 |
User-agent: |
Evolution 3.34.2 |
Le vendredi 19 février 2021 à 08:09 +0100, Dr. Arne Babenhauserheide a
écrit :
> Hi Jérémy,
Hey Dr. Arne !
> Thank you for your book!
My pleasure :)
> How you’re describing char-sets using a clear use-case looks really
> good!
Thank you, I appreciate that.
> A few comments:
>
> # Try and run the test
>
> here you write “the test fails”, which is slightly unprecise. The
> precise wording would be “the test will fail to run”.
You're right, I'm correcting this right now.
> # Write the minimal …
>
> I wonder why the test-suite returns "passes 1" in the second try
> (with
> undefined password-valid?).
This is something very annoying indeed and it forces you to be very
careful.
I haven't the answer to your question. I assume that SRFI-64 catches
the "Unbound variable" exception somehow and return #f which is the
value the test is coincidently waiting for…
Changing the test to
(test-error "empty password is not valid"
#t
(password-valid? ""))
Will pass :
$ guile -L . char-sets-test.scm
;;; note: source file ./char-sets.scm
;;; newer than compiled /home/jeko/.cache/guile/ccache/3.0-LE-8-
4.4/tmp/char-sets.scm.go
;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
;;; or pass the --no-auto-compile argument to disable.
;;; compiling ./char-sets.scm
;;; compiled /home/jeko/.cache/guile/ccache/3.0-LE-8-4.4/tmp/char-
sets.scm.go
%%%% Starting test harness-char-sets (Writing full log to "harness-
char-sets.log")
# of expected passes 1
This indicates an error is raised :
$ cat harness-char-sets.log
%%%% Starting test harness-char-sets
Group begin: harness-char-sets
Test begin:
test-name: "empty password is not valid"
source-file: "char-sets-test.scm"
source-line: 8
source-form: (test-error "empty password is not valid" #t (password-
valid? ""))
Test end:
result-kind: pass
actual-error: (unbound-variable #f "Unbound variable: ~S" (password-
valid?) #f)
expected-error: #t
Group end: harness-char-sets
# of expected passes 1
But I am a bad assumption-er so I should ask to the srfi-64 mailing
list haha. I'm wondering if Guile can return #unspecified ?
> If you want to see the extend to which you can play with macros, you
> can
> have a look at my natural-script-writing entry-point (from enter-
> three-witches):
> https://hg.sr.ht/~arnebab/dryads-wake/browse/enter.w?rev=tip#L349
I will have a look at it, thank you for sharing. I think I will have a
look even to some of your repos. Haha !
> Thank you for your book!
Thank you for reading :-)
Cheers,
Jérémy
- Re: Guile Hacker Handbook - Character sets, (continued)
Re: Guile Hacker Handbook - Character sets, Zelphir Kaltstahl, 2021/02/18
Re: Guile Hacker Handbook - Character sets, divoplade, 2021/02/18
Re: Guile Hacker Handbook - Character sets, Dr. Arne Babenhauserheide, 2021/02/19
- Re: Guile Hacker Handbook - Character sets,
Jérémy Korwin-Zmijowski <=