Skip to content

Commit a66991a

Browse files
committed
Restore mkBlackhole() for testing
1 parent 7156b63 commit a66991a

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/libexpr-tests/value/print.cc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,14 +185,12 @@ TEST_F(ValuePrintingTests, vFloat)
185185
test(vFloat, "2");
186186
}
187187

188-
#if 0
189188
TEST_F(ValuePrintingTests, vBlackhole)
190189
{
191190
Value vBlackhole;
192191
vBlackhole.mkBlackhole();
193192
test(vBlackhole, "«potential infinite recursion»");
194193
}
195-
#endif
196194

197195
TEST_F(ValuePrintingTests, depthAttrs)
198196
{
@@ -632,7 +630,6 @@ TEST_F(ValuePrintingTests, ansiColorsThunk)
632630
});
633631
}
634632

635-
#if 0
636633
TEST_F(ValuePrintingTests, ansiColorsBlackhole)
637634
{
638635
Value v;
@@ -644,7 +641,6 @@ TEST_F(ValuePrintingTests, ansiColorsBlackhole)
644641
.ansiColors = true
645642
});
646643
}
647-
#endif
648644

649645
TEST_F(ValuePrintingTests, ansiColorsAttrsRepeated)
650646
{

src/libexpr/include/nix/expr/value.hh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,12 @@ public:
478478
finishValue(tLambda, { .lambda = { .env = e, .fun = f } });
479479
}
480480

481+
/// Only used for testing.
482+
inline void mkBlackhole()
483+
{
484+
internalType = tPending;
485+
}
486+
481487
void mkPrimOp(PrimOp * p);
482488

483489
inline void mkPrimOpApp(Value * l, Value * r)

0 commit comments

Comments
 (0)