libexpr: abstract string members in Value
to allow multiple internal reps similar to how lists works Change-Id: I94139aab28b04b73b055a3dc05d496758ee72538
This commit is contained in:
@@ -713,14 +713,14 @@ namespace nix {
|
||||
// FIXME: add a test that verifies the string context is as expected
|
||||
auto v = eval("builtins.replaceStrings [\"oo\" \"a\"] [\"a\" \"i\"] \"foobar\"");
|
||||
ASSERT_EQ(v.type(), nString);
|
||||
ASSERT_EQ(v.string.s, std::string_view("fabir"));
|
||||
ASSERT_EQ(v.c_str(), std::string_view("fabir"));
|
||||
}
|
||||
|
||||
TEST_F(PrimOpTest, concatStringsSep) {
|
||||
// FIXME: add a test that verifies the string context is as expected
|
||||
auto v = eval("builtins.concatStringsSep \"%\" [\"foo\" \"bar\" \"baz\"]");
|
||||
ASSERT_EQ(v.type(), nString);
|
||||
ASSERT_EQ(std::string_view(v.string.s), "foo%bar%baz");
|
||||
ASSERT_EQ(std::string_view(v.c_str()), "foo%bar%baz");
|
||||
}
|
||||
|
||||
TEST_F(PrimOpTest, split1) {
|
||||
|
||||
Reference in New Issue
Block a user