diff options
author | Griffin Smith <root@gws.fyi> | 2022-10-10T01·59-0400 |
---|---|---|
committer | grfn <grfn@gws.fyi> | 2022-10-10T20·23+0000 |
commit | 0e9f5d6890df5820be836cff78622d3f1dcfe155 (patch) | |
tree | c1fc503c54e0858082449e5b630df641a4189982 /tvix/eval/tests | |
parent | 66a35de3b67dd441185b7badaf559c8a25ab9967 (diff) |
feat(tvix/eval): Allow adding strings to paths r/5085
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
Diffstat (limited to 'tvix/eval/tests')
-rw-r--r-- | tvix/eval/tests/nix_oracle.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/tvix/eval/tests/nix_oracle.rs b/tvix/eval/tests/nix_oracle.rs index 61f2be674e27..34ed50351053 100644 --- a/tvix/eval/tests/nix_oracle.rs +++ b/tvix/eval/tests/nix_oracle.rs @@ -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}") + (./. + ./.) + ]"#); } |