Skip to content

Commit 67ef50d

Browse files
committed
remove printing in test
1 parent 3314b86 commit 67ef50d

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/backend/evaluate.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,7 +1017,7 @@ mod tests {
10171017
let result = Runtime::evaluate(expression, std::io::stdin(), std::io::stdout());
10181018
result
10191019
}
1020-
fn interpret_io(code_text: &str, read_input: &str) -> (GenericValue, String) {
1020+
fn interpret_io<S: Into<SourceCode>>(code_text: S, read_input: &str) -> (GenericValue, String) {
10211021
let read_input = read_input.bytes().collect::<Vec<u8>>();
10221022
let mut print_output = Vec::<u8>::new();
10231023
let mut program = unwrap_display(lex_and_parse(code_text));
@@ -1170,10 +1170,7 @@ mod tests {
11701170
}
11711171
#[test]
11721172
fn test_intrinsics() {
1173-
let (result, print_output) = interpret_io(
1174-
"'5' |print_char; 0|read_char",
1175-
&"72",
1176-
);
1173+
let (result, print_output) = interpret_io("'5' |print_char; 0|read_char", &"72");
11771174
assert_eq!(result, '7' as u8 as GenericValue);
11781175
assert_eq!(print_output, "5");
11791176
}
@@ -1435,6 +1432,8 @@ mod tests {
14351432
fn test_eval_identifiers() {
14361433
let main_path = PathBuf::from("./pipes_programs/demos/structs.pipes");
14371434
let code = SourceCode::new(main_path).unwrap();
1438-
assert_eq!(interpret(code), 5);
1435+
let (result, out) = interpret_io(code, "");
1436+
assert_eq!(result, 5);
1437+
assert_eq!(out, "x: 5\ny: 5\nz: 3\na: 8\n6\n126\n");
14391438
}
14401439
}

0 commit comments

Comments
 (0)