1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-17 16:02:43 +01:00

tests/functional: Add tests for builtins.dirOf

These will change in the next commit to fix the silent regression from 2.23
in the handling of multiple subsequent path separators.
This commit is contained in:
Sergei Zimmerman 2025-11-09 18:55:11 +03:00
parent 479b6b73a9
commit 86f090837b
No known key found for this signature in database
2 changed files with 22 additions and 0 deletions

View file

@ -0,0 +1 @@
{ pathDoesntExistNested1 = /totallydoesntexistreally; pathDoesntExistNested2 = /totallydoesntexistreally/subdir1; pathDoesntExistRoot = /; pathRoot = /; stringEmpty = "."; stringMultipleSeps = "a"; stringNoSep = "."; stringRoot = "/"; stringRootA = "/"; stringRootSlash = "//"; stringRootSlashSlash = "///"; stringSingleDir = "a"; stringWithDot = "a/b/c/."; stringWithDotAndDotDot = "a/b/c/../."; stringWithDotAndDotDotSep2 = "a/b/c/../."; stringWithDotDot = "a/b/c/.."; stringWithDotDotSep2 = "a/b/c/.."; stringWithDotSep2 = "a/b/c/."; }

View file

@ -0,0 +1,21 @@
{
stringEmpty = dirOf "";
stringNoSep = dirOf "filename";
stringSingleDir = dirOf "a/b";
stringMultipleSeps = dirOf "a///b";
stringRoot = dirOf "/";
stringRootSlash = dirOf "//";
stringRootSlashSlash = dirOf "///";
stringRootA = dirOf "/a";
stringWithDot = dirOf "a/b/c/./d";
stringWithDotSep2 = dirOf "a/b/c/.//d";
stringWithDotDot = dirOf "a/b/c/../d";
stringWithDotDotSep2 = dirOf "a/b/c/..//d";
stringWithDotAndDotDot = dirOf "a/b/c/.././d";
stringWithDotAndDotDotSep2 = dirOf "a/b/c/.././/d";
pathRoot = dirOf /.;
pathDoesntExistRoot = dirOf /totallydoesntexistreally;
pathDoesntExistNested1 = dirOf /totallydoesntexistreally/subdir1;
pathDoesntExistNested2 = dirOf /totallydoesntexistreally/subdir1/subdir2;
}