feat(tvix/eval): Allow adding strings to paths
Implement adding paths and strings via OpAdd. Since the nix rules are quite obscure, I'm electing to test this one with an oracle test to avoid the danger of getting the actual asserted result wrong. Change-Id: Icdcca3690ca2e8459e386c1f29cc48eaaa39e9a3 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6914 Autosubmit: grfn <grfn@gws.fyi> Reviewed-by: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI
This commit is contained in:
parent
66a35de3b6
commit
0e9f5d6890
5 changed files with 40 additions and 6 deletions
|
|
@ -15,7 +15,7 @@ fn nix_eval(expr: &str) -> String {
|
|||
let store_dir = TempDir::new("store-dir").unwrap();
|
||||
|
||||
let output = Command::new(nix_binary_path())
|
||||
.args(["--eval", "-E"])
|
||||
.args(["--eval", "--strict", "-E"])
|
||||
.arg(format!("({expr})"))
|
||||
.env(
|
||||
"NIX_REMOTE",
|
||||
|
|
@ -66,4 +66,13 @@ compare_eval_tests! {
|
|||
literal_int("1");
|
||||
add_ints("1 + 1");
|
||||
add_lists("[1 2] ++ [3 4]");
|
||||
add_paths(r#"[
|
||||
(./. + "/")
|
||||
(./foo + "bar")
|
||||
(let name = "bar"; in ./foo + name)
|
||||
(let name = "bar"; in ./foo + "${name}")
|
||||
(let name = "bar"; in ./foo + "/" + "${name}")
|
||||
(let name = "bar"; in ./foo + "/${name}")
|
||||
(./. + ./.)
|
||||
]"#);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue