aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/tests/json.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2022-08-03 17:45:11 +0200
committerEelco Dolstra <edolstra@gmail.com>2022-08-03 17:46:51 +0200
commitccbd906c86cb10e5c7b49753e057fec4ab46233c (patch)
tree1ce61fe78b6b2c4498592281a1a2488b043e7e5c /src/libutil/tests/json.cc
parent7d1ccd9105e418ac6948685244b3b4e0cb0cd368 (diff)
Fix NIX_COUNT_CALLS=1
Also, make the JSON writer support std::string_view. Fixes #6857.
Diffstat (limited to 'src/libutil/tests/json.cc')
-rw-r--r--src/libutil/tests/json.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libutil/tests/json.cc b/src/libutil/tests/json.cc
index dea73f53a..156286999 100644
--- a/src/libutil/tests/json.cc
+++ b/src/libutil/tests/json.cc
@@ -102,8 +102,8 @@ namespace nix {
TEST(toJSON, substringEscape) {
std::stringstream out;
- const char *s = "foo\t";
- toJSON(out, s+3, s + strlen(s));
+ std::string_view s = "foo\t";
+ toJSON(out, s.substr(3));
ASSERT_EQ(out.str(), "\"\\t\"");
}