1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 16:51:15 +02:00

Fix NIX_COUNT_CALLS=1

Also, make the JSON writer support std::string_view.

Fixes #6857.
This commit is contained in:
Eelco Dolstra 2022-08-03 17:45:11 +02:00
parent 7d1ccd9105
commit ccbd906c86
4 changed files with 22 additions and 26 deletions

View file

@ -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\"");
}