mirror of
https://github.com/janet-lang/janet
synced 2026-09-01 15:18:51 +00:00
Print "actual" output on verbose mode for suite-peg
This commit is contained in:
+2
-2
@@ -220,9 +220,9 @@ tail:
|
||||
janet_eprintf("tag stack [%d]:\n", s->tagged_captures->count);
|
||||
for (int32_t i = 0; i < s->tagged_captures->count; i++) {
|
||||
if (has_color) {
|
||||
janet_eprintf(" [%d] tag=%d: %M\n", i, s->tags->data[i], s->tagged_captures->data[i]);
|
||||
janet_eprintf(" [%d] tag=%d: %M\n", i, (int32_t) s->tags->data[i], s->tagged_captures->data[i]);
|
||||
} else {
|
||||
janet_eprintf(" [%d] tag=%d: %m\n", i, s->tags->data[i], s->tagged_captures->data[i]);
|
||||
janet_eprintf(" [%d] tag=%d: %m\n", i, (int32_t) s->tags->data[i], s->tagged_captures->data[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+30
-22
@@ -856,37 +856,45 @@
|
||||
(def actual @"")
|
||||
(with-dyns [:err actual *err-color* true]
|
||||
(test name peg input expected-matches))
|
||||
(assert (deep= (string/replace-all "\r" "" actual) expected-stderr)))
|
||||
(when (os/getenv "VERBOSE")
|
||||
(eprint actual))
|
||||
(assert (deep= (string actual) expected-stderr)))
|
||||
|
||||
(defn test-stderr-no-color [name peg input expected-matches expected-stderr]
|
||||
(def actual @"")
|
||||
(with-dyns [:err actual *err-color* false]
|
||||
(test name peg input expected-matches))
|
||||
(assert (deep= (string/replace-all "\r" "" actual) expected-stderr)))
|
||||
(when (os/getenv "VERBOSE")
|
||||
(eprint actual))
|
||||
(assert (deep= (string actual) expected-stderr)))
|
||||
|
||||
(test-stderr "?? long form"
|
||||
'(* (debug) "abc")
|
||||
"abc"
|
||||
@[]
|
||||
"?? at [abc] (index 0)\n")
|
||||
(test-stderr
|
||||
"?? long form"
|
||||
'(* (debug) "abc")
|
||||
"abc"
|
||||
@[]
|
||||
"?? at [abc] (index 0)\n")
|
||||
|
||||
(test-stderr "?? short form"
|
||||
'(* (??) "abc")
|
||||
"abc"
|
||||
@[]
|
||||
"?? at [abc] (index 0)\n")
|
||||
(test-stderr
|
||||
"?? short form"
|
||||
'(* (??) "abc")
|
||||
"abc"
|
||||
@[]
|
||||
"?? at [abc] (index 0)\n")
|
||||
|
||||
(test-stderr "?? end of text"
|
||||
'(* "abc" (??))
|
||||
"abc"
|
||||
@[]
|
||||
"?? at [] (index 3)\n")
|
||||
(test-stderr
|
||||
"?? end of text"
|
||||
'(* "abc" (??))
|
||||
"abc"
|
||||
@[]
|
||||
"?? at [] (index 3)\n")
|
||||
|
||||
(test-stderr "?? between rules"
|
||||
'(* "a" (??) "bc")
|
||||
"abc"
|
||||
@[]
|
||||
"?? at [bc] (index 1)\n")
|
||||
(test-stderr
|
||||
"?? between rules"
|
||||
'(* "a" (??) "bc")
|
||||
"abc"
|
||||
@[]
|
||||
"?? at [bc] (index 1)\n")
|
||||
|
||||
(test-stderr
|
||||
"?? stack display, string"
|
||||
|
||||
Reference in New Issue
Block a user