aboutsummaryrefslogtreecommitdiffstats
path: root/nihil.ucl/tests/emit.cc
diff options
context:
space:
mode:
authorLexi Winter <lexi@le-fay.org>2025-06-22 15:34:48 +0100
committerLexi Winter <lexi@le-fay.org>2025-06-22 15:34:48 +0100
commit429be0c13e16b51b8fc7695c5f3ff65ac057fca7 (patch)
treeffe19573dbafa2e49680ea0395a63690eb721efd /nihil.ucl/tests/emit.cc
parenta14cb70cb715beb714e7b05d8fe631c0df4a7053 (diff)
downloadnihil-429be0c13e16b51b8fc7695c5f3ff65ac057fca7.tar.gz
nihil-429be0c13e16b51b8fc7695c5f3ff65ac057fca7.tar.bz2
nihil.ucl: add a range test for array
Diffstat (limited to 'nihil.ucl/tests/emit.cc')
-rw-r--r--nihil.ucl/tests/emit.cc10
1 files changed, 2 insertions, 8 deletions
diff --git a/nihil.ucl/tests/emit.cc b/nihil.ucl/tests/emit.cc
index c7f9757..a8487c6 100644
--- a/nihil.ucl/tests/emit.cc
+++ b/nihil.ucl/tests/emit.cc
@@ -18,14 +18,8 @@ TEST_CASE("ucl: emit to std::ostream", "[ucl]")
auto strm = std::ostringstream();
strm << obj;
- REQUIRE(strm.str() ==
-"{\n"
-" \"int\": [\n"
-" 1,\n"
-" 42,\n"
-" 666\n"
-" ]\n"
-"}");
+ // The ostream emitter produces JSON.
+ REQUIRE(strm.str() == std::format("{:j}", obj));
}
TEST_CASE("ucl: emit JSON with std::format", "[ucl]")