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();
@@ -33,3 +34,8 @@ fn advanced6_recurse2() {
fn advanced6_recurse3() {
run_calc("8!?.", "40320\n");
}
#[test]
fn advanced6_recurse4() {
run_calc("5!5+?.", "125\n");
}