1
0
mirror of https://github.com/janet-lang/janet synced 2026-06-04 11:42:17 +00:00

VERBOSE=1 caused tests to fail as we did more asserts inside the assert.

Thenc checked stderr for messages. Since the helper makes assert write
to stderr, this caused extra cruft in our test output.
This commit is contained in:
Calvin Rose
2026-02-06 00:17:11 -06:00
parent ca5c617fba
commit d2685594f9
2 changed files with 5 additions and 9 deletions
+1 -1
View File
@@ -198,7 +198,7 @@ tail:
char buffer[32] = {0};
size_t len = (size_t)(s->outer_text_end - text);
memcpy(buffer, text, (len > 31 ? 31 : len));
janet_eprintf("?? at [%s] (index %d)\n", buffer, (int32_t)(text - s->text_start));
janet_eprintf("?? at [%s] (index %D)\n", buffer, (int64_t)(text - s->text_start));
int has_color = janet_truthy(janet_dyn("err-color"));
/* Accumulate buffer */
if (s->scratch->count) {
+4 -8
View File
@@ -853,21 +853,17 @@
# Debug and ?? tests.
(defn test-stderr [name peg input expected-matches expected-stderr]
(test name peg input expected-matches)
(def actual @"")
(with-dyns [:err actual *err-color* true]
(test name peg input expected-matches))
(when (os/getenv "VERBOSE")
(eprint (describe actual))
(eprint (describe expected-stderr)))
(peg/match peg input))
(assert (deep= (string actual) expected-stderr)))
(defn test-stderr-no-color [name peg input expected-matches expected-stderr]
(test name peg input expected-matches)
(def actual @"")
(with-dyns [:err actual *err-color* false]
(test name peg input expected-matches))
(when (os/getenv "VERBOSE")
(eprint (describe actual))
(eprint (describe expected-stderr)))
(peg/match peg input))
(assert (deep= (string actual) expected-stderr)))
(test-stderr