diff options
author | Griffin Smith <root@gws.fyi> | 2022-09-18T19·59-0400 |
---|---|---|
committer | clbot <clbot@tvl.fyi> | 2022-09-18T22·08+0000 |
commit | e720545e5b32683a3cdb135b6004a06304e025aa (patch) | |
tree | 33414930f82266722a53a184604a694448bd6a2b /tvix/eval/src/tests/mod.rs | |
parent | 6f70f325138b48f2c9b03a2103371663cb210d7c (diff) |
refactor(tvix/eval): use Clap for arg+env parsing r/4911
Refactor the environment variable and argument parsing for the tvix repl to use Clap instead of doing things ad-hoc, and thread through options obtained from environment variables via explicit arguments rather than obtaining them from the environment as they're needed. This makes adding more flags more sustainable, and also makes the binary fully self-documenting, including supported env vars, via `--help`. Change-Id: Ib1f6a0cd20056e8c9196760ff755fa5729667760 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6653 Autosubmit: grfn <grfn@gws.fyi> Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su>
Diffstat (limited to 'tvix/eval/src/tests/mod.rs')
-rw-r--r-- | tvix/eval/src/tests/mod.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tvix/eval/src/tests/mod.rs b/tvix/eval/src/tests/mod.rs index ec9ee0d1c9ea..49ca35973e56 100644 --- a/tvix/eval/src/tests/mod.rs +++ b/tvix/eval/src/tests/mod.rs @@ -12,7 +12,8 @@ fn eval_okay_test(code_path: &str) { let code = std::fs::read_to_string(code_path).expect("should be able to read test code"); let exp = std::fs::read_to_string(exp_path).expect("should be able to read test expectation"); - let result = interpret(&code, None).expect("evaluation of eval-okay test should succeed"); + let result = interpret(&code, None, Default::default()) + .expect("evaluation of eval-okay test should succeed"); let result_str = format!("{}", result); assert_eq!( @@ -28,7 +29,8 @@ fn eval_okay_test(code_path: &str) { fn identity(code_path: &str) { let code = std::fs::read_to_string(code_path).expect("should be able to read test code"); - let result = interpret(&code, None).expect("evaluation of identity test should succeed"); + let result = interpret(&code, None, Default::default()) + .expect("evaluation of identity test should succeed"); let result_str = format!("{}", result); assert_eq!( |