[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

issues unit testing with srfi-64

From: Aleix Conchillo Flaqué
Subject: issues unit testing with srfi-64
Date: Sat, 29 Dec 2018 15:50:18 -0800


happy holidays and almost happy new year to everyone!

I've added unit tests to guile-json and I have found a couple of
issues. This is the branch:

First one (which might not be a real issue) is that (test-end) doesn't
exit with an exit status different than 0 if a test fails. And this
will cause automake to believe the tests passed when they actually did
not. I have solved this with the following which works for my use
case, but I'm not sure if that's the right way:
   (test-end "test-builder")

   (exit (if (eqv? 0 (test-runner-fail-count (test-runner-current))) 0 1))

(I could have returned the fail-count directly, but since there are
only 255 exit values I thought it could wrap around.)

The other issue is that the beginning of the log files are corrupted:

%%%% Starting test test-builder  (Writing full log to "test-builder.log")
# of expected passes      19
  source-line: 33
  source-form: (test-equal "1234" (scm->json-string 1234))

This should be something like:

Test begin:
  source-file: "tests/test-builder.scm"
  source-line: 33
  source-form: (test-equal "1234" (scm->json-string 1234))
Test end:
  result-kind: pass
  actual-value: "1234"
  expected-value: "1234"

I don't know how to fix this one yet.

Has anyone else found these issues before?

Thanks in advance!


reply via email to

[Prev in Thread] Current Thread [Next in Thread]