hare

The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit 0c101ac5dddc96c2a80b7fcc9651cfa9a4a1eb76
parent 6cdd397ddba871ec08b248586abe44ff8a7c2c27
Author: Sebastian <sebastian@sebsite.pw>
Date:   Sat,  9 Apr 2022 14:26:38 -0400

format::xml: more informative error in xmltest

This was taken from hare::parse::roundtrip

Signed-off-by: Sebastian <sebastian@sebsite.pw>

Diffstat:
Mformat/xml/+test.ha | 6+++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/format/xml/+test.ha b/format/xml/+test.ha @@ -107,7 +107,11 @@ fn xmltest(input: str, expected: []token, err: bool) void = { assert(at.0 == ex.0 && at.1 == ex.1); case let tx: text => let ex = expected[i] as text; - assert(tx == ex); + if (tx != ex) { + fmt::errorfln("=== wanted\n{}", ex)!; + fmt::errorfln("=== got\n{}", tx)!; + abort(); + }; case let el: elementend => let ex = expected[i] as elementend; assert(el == ex);