diff options
| author | Arnaud Bailly <arnaud.bailly@iohk.io> | 2024-09-29 17:26:45 +0200 |
|---|---|---|
| committer | Arnaud Bailly <arnaud.bailly@iohk.io> | 2024-09-29 17:26:45 +0200 |
| commit | 96d6a0a2b562f81c5c14532487ce03a1a9065e6b (patch) | |
| tree | 0137b403fe0e8fdfbbe979f4081ae25cabdc96f2 /rust/tests | |
| parent | 9dcff1ea1b11f765f074d9b93e67bc6760f52049 (diff) | |
| download | lambda-nantes-96d6a0a2b562f81c5c14532487ce03a1a9065e6b.tar.gz | |
Implement sub-process based tester
Diffstat (limited to 'rust/tests')
| -rw-r--r-- | rust/tests/interpret_test.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/rust/tests/interpret_test.rs b/rust/tests/interpret_test.rs index 0ca3356..16e7fb7 100644 --- a/rust/tests/interpret_test.rs +++ b/rust/tests/interpret_test.rs @@ -1,4 +1,4 @@ -use lambda::io::{eval_file, repl}; +use lambda::io::{batch_eval, eval_file, repl}; #[test] fn interpreter_can_read_and_interpret_file() { @@ -15,3 +15,11 @@ fn repl_can_read_and_interpret_input() { repl(&mut input.as_bytes(), &mut output); assert_eq!("> true\n> 12\n> ", String::from_utf8(output).unwrap()); } + +#[test] +fn repl_can_read_and_interpret_input_in_batch_mode() { + let input = "(def id (lam x x))\n(id 12)"; + let mut output = Vec::new(); + batch_eval(&mut input.as_bytes(), &mut output); + assert_eq!("true\n12\n", String::from_utf8(output).unwrap()); +} |
