-
-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: Add function calls with list-heavy arguments
- Loading branch information
1 parent
d0c0cda
commit 7c0a82c
Showing
3 changed files
with
308 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# This file contains an assortment of test cases involving list-heavy function calls | ||
|
||
[ | ||
(f [ ] [ rhs lhs ]) | ||
(lib.mkMerge [ false false ]) | ||
(replaceStrings | ||
[ "\${" "''" ] | ||
#force multiline | ||
[ "''\${" "'''" ]) | ||
(replaceStrings [ ''"'' "\\" ] [ ''\"'' "\\\\" ] name) | ||
(replaceStrings | ||
[ ''"'' "\\" ] | ||
# force multiline | ||
[ ''\"'' "\\\\" ] | ||
name) | ||
(replaceStrings | ||
[ "@" ":" "\\" "[" "]" ] | ||
[ "-" "-" "-" "" "" ]) | ||
(lists.removePrefix [ 1 2 ] [ ]) | ||
(lists.removePrefix aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa [ 1 2 ] [ ]) | ||
(builtins.replaceStrings | ||
[ "@NIX_STORE_VERITY@" ] | ||
[partitionTypes.usr-verity] | ||
(builtins.readFile ./assert_uki_repart_match.py)) | ||
(replaceStrings [ "-" ] [ "_" ] (toUpper final.rust.cargoShortTarget)) | ||
(lib.mkChangedOptionModule | ||
[ "security" "acme" "validMin" ] | ||
[ "security" "acme" "defaults" "validMinDays" ] | ||
(config: config.security.acme.validMin / (24 * 3600))) | ||
(lib.replaceStrings | ||
[ "https://registry" ".io/providers" ] | ||
[ "registry" ".io" ] | ||
homepage) | ||
(lib.mkRenamedOptionModule [ "boot" "extraTTYs" ] [ "console" "extraTTYs" ]) | ||
(mkRenamedOptionModule [ | ||
"services" | ||
"xserver" | ||
"displayManager" | ||
"sddm" | ||
"enable" | ||
] [ "services" "displayManager" "sddm" "enable" ]) | ||
(map (buildAllowCommand "allow" [ "snapshot" "mount" "destroy" ])) | ||
(map (x: "${x} ${escapeShellArgs [ stateDir workDir logsDir ]}") [ | ||
"+${unconfigureRunner}" # runs as root | ||
configureRunner | ||
setupWorkDir | ||
]) | ||
(lib.switch [ coq.coq-version ssreflect.version ] [ | ||
{ | ||
cases = [ | ||
(lib.versions.range "8.15" "8.20") | ||
lib.pred.true | ||
]; | ||
out = "2.0.4"; | ||
} | ||
{ | ||
cases = [ | ||
"8.5" | ||
lib.pred.true | ||
]; | ||
out = "20170512"; | ||
} | ||
] null) | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
# This file contains an assortment of test cases involving list-heavy function calls | ||
|
||
[ | ||
(f [ ] [ | ||
rhs | ||
lhs | ||
]) | ||
(lib.mkMerge [ | ||
false | ||
false | ||
]) | ||
(replaceStrings [ "\${" "''" ] | ||
#force multiline | ||
[ | ||
"''\${" | ||
"'''" | ||
] | ||
) | ||
(replaceStrings [ ''"'' "\\" ] [ ''\"'' "\\\\" ] name) | ||
(replaceStrings [ ''"'' "\\" ] | ||
# force multiline | ||
[ ''\"'' "\\\\" ] | ||
name | ||
) | ||
(replaceStrings | ||
[ | ||
"@" | ||
":" | ||
"\\" | ||
"[" | ||
"]" | ||
] | ||
[ | ||
"-" | ||
"-" | ||
"-" | ||
"" | ||
"" | ||
] | ||
) | ||
(lists.removePrefix [ | ||
1 | ||
2 | ||
] [ ]) | ||
(lists.removePrefix aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa [ | ||
1 | ||
2 | ||
] [ ]) | ||
(builtins.replaceStrings [ "@NIX_STORE_VERITY@" ] [ | ||
partitionTypes.usr-verity | ||
] (builtins.readFile ./assert_uki_repart_match.py)) | ||
(replaceStrings [ "-" ] [ "_" ] (toUpper final.rust.cargoShortTarget)) | ||
(lib.mkChangedOptionModule [ "security" "acme" "validMin" ] [ | ||
"security" | ||
"acme" | ||
"defaults" | ||
"validMinDays" | ||
] (config: config.security.acme.validMin / (24 * 3600))) | ||
(lib.replaceStrings [ "https://registry" ".io/providers" ] [ | ||
"registry" | ||
".io" | ||
] homepage) | ||
(lib.mkRenamedOptionModule [ "boot" "extraTTYs" ] [ | ||
"console" | ||
"extraTTYs" | ||
]) | ||
(mkRenamedOptionModule | ||
[ | ||
"services" | ||
"xserver" | ||
"displayManager" | ||
"sddm" | ||
"enable" | ||
] | ||
[ | ||
"services" | ||
"displayManager" | ||
"sddm" | ||
"enable" | ||
] | ||
) | ||
(map ( | ||
buildAllowCommand "allow" [ | ||
"snapshot" | ||
"mount" | ||
"destroy" | ||
] | ||
)) | ||
(map | ||
( | ||
x: | ||
"${x} ${ | ||
escapeShellArgs [ | ||
stateDir | ||
workDir | ||
logsDir | ||
] | ||
}" | ||
) | ||
[ | ||
"+${unconfigureRunner}" # runs as root | ||
configureRunner | ||
setupWorkDir | ||
] | ||
) | ||
(lib.switch [ coq.coq-version ssreflect.version ] [ | ||
{ | ||
cases = [ | ||
(lib.versions.range "8.15" "8.20") | ||
lib.pred.true | ||
]; | ||
out = "2.0.4"; | ||
} | ||
{ | ||
cases = [ | ||
"8.5" | ||
lib.pred.true | ||
]; | ||
out = "20170512"; | ||
} | ||
] null) | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
# This file contains an assortment of test cases involving list-heavy function calls | ||
|
||
[ | ||
(f [ ] [ | ||
rhs | ||
lhs | ||
]) | ||
(lib.mkMerge [ | ||
false | ||
false | ||
]) | ||
(replaceStrings [ "\${" "''" ] | ||
#force multiline | ||
[ | ||
"''\${" | ||
"'''" | ||
] | ||
) | ||
(replaceStrings [ ''"'' "\\" ] [ ''\"'' "\\\\" ] name) | ||
(replaceStrings [ ''"'' "\\" ] | ||
# force multiline | ||
[ ''\"'' "\\\\" ] | ||
name | ||
) | ||
(replaceStrings | ||
[ | ||
"@" | ||
":" | ||
"\\" | ||
"[" | ||
"]" | ||
] | ||
[ | ||
"-" | ||
"-" | ||
"-" | ||
"" | ||
"" | ||
] | ||
) | ||
(lists.removePrefix [ | ||
1 | ||
2 | ||
] [ ]) | ||
(lists.removePrefix aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa [ | ||
1 | ||
2 | ||
] [ ]) | ||
(builtins.replaceStrings [ "@NIX_STORE_VERITY@" ] [ | ||
partitionTypes.usr-verity | ||
] (builtins.readFile ./assert_uki_repart_match.py)) | ||
(replaceStrings [ "-" ] [ "_" ] (toUpper final.rust.cargoShortTarget)) | ||
(lib.mkChangedOptionModule [ "security" "acme" "validMin" ] [ | ||
"security" | ||
"acme" | ||
"defaults" | ||
"validMinDays" | ||
] (config: config.security.acme.validMin / (24 * 3600))) | ||
(lib.replaceStrings [ "https://registry" ".io/providers" ] [ | ||
"registry" | ||
".io" | ||
] homepage) | ||
(lib.mkRenamedOptionModule [ "boot" "extraTTYs" ] [ | ||
"console" | ||
"extraTTYs" | ||
]) | ||
(mkRenamedOptionModule | ||
[ | ||
"services" | ||
"xserver" | ||
"displayManager" | ||
"sddm" | ||
"enable" | ||
] | ||
[ | ||
"services" | ||
"displayManager" | ||
"sddm" | ||
"enable" | ||
] | ||
) | ||
(map ( | ||
buildAllowCommand "allow" [ | ||
"snapshot" | ||
"mount" | ||
"destroy" | ||
] | ||
)) | ||
(map | ||
( | ||
x: | ||
"${x} ${ | ||
escapeShellArgs [ | ||
stateDir | ||
workDir | ||
logsDir | ||
] | ||
}" | ||
) | ||
[ | ||
"+${unconfigureRunner}" # runs as root | ||
configureRunner | ||
setupWorkDir | ||
] | ||
) | ||
(lib.switch [ coq.coq-version ssreflect.version ] [ | ||
{ | ||
cases = [ | ||
(lib.versions.range "8.15" "8.20") | ||
lib.pred.true | ||
]; | ||
out = "2.0.4"; | ||
} | ||
{ | ||
cases = [ | ||
"8.5" | ||
lib.pred.true | ||
]; | ||
out = "20170512"; | ||
} | ||
] null) | ||
] |