From d2685594f9911a462c6368f045562b0f262a02bf Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Fri, 6 Feb 2026 00:17:11 -0600 Subject: [PATCH] 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. --- src/core/peg.c | 2 +- test/suite-peg.janet | 12 ++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/core/peg.c b/src/core/peg.c index 5e488886..d98584ae 100644 --- a/src/core/peg.c +++ b/src/core/peg.c @@ -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) { diff --git a/test/suite-peg.janet b/test/suite-peg.janet index a3edaca4..678150e4 100644 --- a/test/suite-peg.janet +++ b/test/suite-peg.janet @@ -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