Make all tests not output anything

This commit is contained in:
2019-05-29 15:57:20 +02:00
parent a79d5b8aac
commit 03eb6d685b
16 changed files with 78 additions and 6 deletions

View File

@@ -4,8 +4,9 @@ use std::sync::{Arc, Mutex};
use std::io::{Cursor, Seek, SeekFrom, Read};
fn run_calc(input: &'static str, expected: &str) {
let rc = Arc::new(Mutex::new(Cursor::new(Vec::new())));
let rc = rustijvm::stubs::output_stub();
let mut machine = rustijvm::Machine::new_from_file("files/advanced/SimpleCalc.ijvm").unwrap();
machine.set_input(Box::new(input.as_bytes()));
machine.set_output(rc.clone());
machine.run().unwrap();
@@ -38,3 +39,8 @@ fn advanced5_level3() {
run_calc("1 1 + 1 1 + 1 1 + 1 1 + 1 1 + +-++?.", "2\n");
run_calc("9 8 -9 7-9 6-9 5-9 4-9 3-9 2-9 1-9 0- -+-+-+-+?.", "1\n");
}
#[test]
fn advanced5_level4() {
run_calc("2 2 2 2 2 2 2 2 2 2 2 2 2 ************ +?.", "8192\n");
}