1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-09 03:56:01 +01:00

Fix an update to a finished value

This commit is contained in:
Eelco Dolstra 2025-10-27 15:01:46 +01:00
parent fb26285458
commit 8c8b706f6b

View file

@ -10,7 +10,7 @@ using namespace testing;
struct ValuePrintingTests : LibExprTest struct ValuePrintingTests : LibExprTest
{ {
template<class... A> template<class... A>
void test(Value v, std::string_view expected, A... args) void test(Value & v, std::string_view expected, A... args)
{ {
std::stringstream out; std::stringstream out;
v.print(state, out, args...); v.print(state, out, args...);
@ -625,10 +625,11 @@ TEST_F(ValuePrintingTests, ansiColorsAttrsElided)
vThree.mkInt(3); vThree.mkInt(3);
builder.insert(state.symbols.create("three"), &vThree); builder.insert(state.symbols.create("three"), &vThree);
vAttrs.mkAttrs(builder.finish()); Value vAttrs2;
vAttrs2.mkAttrs(builder.finish());
test( test(
vAttrs, vAttrs2,
"{ one = " ANSI_CYAN "1" ANSI_NORMAL "; " ANSI_FAINT "«2 attributes elided»" ANSI_NORMAL " }", "{ one = " ANSI_CYAN "1" ANSI_NORMAL "; " ANSI_FAINT "«2 attributes elided»" ANSI_NORMAL " }",
PrintOptions{.ansiColors = true, .maxAttrs = 1}); PrintOptions{.ansiColors = true, .maxAttrs = 1});
} }