mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2025-01-19 17:46:46 +02:00
Add boost::regex regression test
This commit is contained in:
parent
908a011a4a
commit
333ea684b0
1 changed files with 8 additions and 0 deletions
|
@ -814,6 +814,14 @@ namespace nix {
|
||||||
ASSERT_THAT(*v.listElems()[0], IsStringEq("FOO"));
|
ASSERT_THAT(*v.listElems()[0], IsStringEq("FOO"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_F(PrimOpTest, match5) {
|
||||||
|
// The regex "\\{}" is valid and matches the string "{}".
|
||||||
|
// Caused a regression before when trying to switch from std::regex to boost::regex.
|
||||||
|
// See https://github.com/NixOS/nix/pull/7762#issuecomment-1834303659
|
||||||
|
auto v = eval("builtins.match \"\\\\{}\" \"{}\"");
|
||||||
|
ASSERT_THAT(v, IsListOfSize(0));
|
||||||
|
}
|
||||||
|
|
||||||
TEST_F(PrimOpTest, attrNames) {
|
TEST_F(PrimOpTest, attrNames) {
|
||||||
auto v = eval("builtins.attrNames { x = 1; y = 2; z = 3; a = 2; }");
|
auto v = eval("builtins.attrNames { x = 1; y = 2; z = 3; a = 2; }");
|
||||||
ASSERT_THAT(v, IsListOfSize(4));
|
ASSERT_THAT(v, IsListOfSize(4));
|
||||||
|
|
Loading…
Reference in a new issue