aboutsummaryrefslogtreecommitdiff
path: root/tests/unit/libexpr/trivial.cc
diff options
context:
space:
mode:
authorpiegames <git@piegames.de>2024-07-13 05:24:41 +0200
committerpiegames <git@piegames.de>2024-08-17 19:47:51 +0200
commit49d61b2e4bf338042364c85d3c2ead0b33963e65 (patch)
tree09ffba6841df5a3990aa2d1c6bb9e19e0e355b14 /tests/unit/libexpr/trivial.cc
parent1c080a8239f1be5a61d9fb2121ca958542ec183f (diff)
libexpr: Introduce Deprecated features
They are like experimental features, but opt-in instead of opt-out. They will allow us to gracefully remove language features. See #437 Change-Id: I9ca04cc48e6926750c4d622c2b229b25cc142c42
Diffstat (limited to 'tests/unit/libexpr/trivial.cc')
-rw-r--r--tests/unit/libexpr/trivial.cc26
1 files changed, 13 insertions, 13 deletions
diff --git a/tests/unit/libexpr/trivial.cc b/tests/unit/libexpr/trivial.cc
index c984657fd..46f9b7499 100644
--- a/tests/unit/libexpr/trivial.cc
+++ b/tests/unit/libexpr/trivial.cc
@@ -214,36 +214,36 @@ namespace nix {
// pipes are gated behind an experimental feature flag
TEST_F(TrivialExpressionTest, pipeDisabled) {
ASSERT_THROW(eval("let add = l: r: l + r; in ''a'' |> add ''b''"), Error);
- ASSERT_THROW(eval("let add = l: r: l + r; in ''a'' <| add ''b''"), Error);
+ ASSERT_THROW(eval("let add = l: r: l + r; in add ''a'' <| ''b''"), Error);
}
TEST_F(TrivialExpressionTest, pipeRight) {
- ExperimentalFeatureSettings mockXpSettings;
- mockXpSettings.set("experimental-features", "pipe-operator");
+ FeatureSettings mockFeatureSettings;
+ mockFeatureSettings.set("experimental-features", "pipe-operator");
- auto v = eval("let add = l: r: l + r; in ''a'' |> add ''b''", true, mockXpSettings);
+ auto v = eval("let add = l: r: l + r; in ''a'' |> add ''b''", true, mockFeatureSettings);
ASSERT_THAT(v, IsStringEq("ba"));
- v = eval("let add = l: r: l + r; in ''a'' |> add ''b'' |> add ''c''", true, mockXpSettings);
+ v = eval("let add = l: r: l + r; in ''a'' |> add ''b'' |> add ''c''", true, mockFeatureSettings);
ASSERT_THAT(v, IsStringEq("cba"));
}
TEST_F(TrivialExpressionTest, pipeLeft) {
- ExperimentalFeatureSettings mockXpSettings;
- mockXpSettings.set("experimental-features", "pipe-operator");
+ FeatureSettings mockFeatureSettings;
+ mockFeatureSettings.set("experimental-features", "pipe-operator");
- auto v = eval("let add = l: r: l + r; in add ''a'' <| ''b''", true, mockXpSettings);
+ auto v = eval("let add = l: r: l + r; in add ''a'' <| ''b''", true, mockFeatureSettings);
ASSERT_THAT(v, IsStringEq("ab"));
- v = eval("let add = l: r: l + r; in add ''a'' <| add ''b'' <| ''c''", true, mockXpSettings);
+ v = eval("let add = l: r: l + r; in add ''a'' <| add ''b'' <| ''c''", true, mockFeatureSettings);
ASSERT_THAT(v, IsStringEq("abc"));
}
TEST_F(TrivialExpressionTest, pipeMixed) {
- ExperimentalFeatureSettings mockXpSettings;
- mockXpSettings.set("experimental-features", "pipe-operator");
+ FeatureSettings mockFeatureSettings;
+ mockFeatureSettings.set("experimental-features", "pipe-operator");
- auto v = eval("let add = l: r: l + r; in add ''a'' <| ''b'' |> add ''c''", true, mockXpSettings);
+ auto v = eval("let add = l: r: l + r; in add ''a'' <| ''b'' |> add ''c''", true, mockFeatureSettings);
ASSERT_THAT(v, IsStringEq("acb"));
- v = eval("let add = l: r: l + r; in ''a'' |> add <| ''c''", true, mockXpSettings);
+ v = eval("let add = l: r: l + r; in ''a'' |> add <| ''c''", true, mockFeatureSettings);
ASSERT_THAT(v, IsStringEq("ac"));
}
} /* namespace nix */