summaryrefslogtreecommitdiff
path: root/rust/tests/interpret_test.rs
diff options
context:
space:
mode:
Diffstat (limited to 'rust/tests/interpret_test.rs')
-rw-r--r--rust/tests/interpret_test.rs10
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());
+}