Make all tests not output anything
This commit is contained in:
@@ -9,6 +9,8 @@ fn steps(machine: &mut rustijvm::Machine, num: usize) {
|
||||
#[test]
|
||||
fn task3_goto1() {
|
||||
let mut machine = rustijvm::Machine::new_from_file("files/task3/GOTO1.ijvm").unwrap();
|
||||
machine.set_output(rustijvm::stubs::output_stub());
|
||||
|
||||
steps(&mut machine, 1);
|
||||
assert_eq!(machine.get_tos(), Ok(0x31));
|
||||
steps(&mut machine, 3);
|
||||
@@ -19,6 +21,8 @@ fn task3_goto1() {
|
||||
#[test]
|
||||
fn task3_goto2() {
|
||||
let mut machine = rustijvm::Machine::new_from_file("files/task3/GOTO2.ijvm").unwrap();
|
||||
machine.set_output(rustijvm::stubs::output_stub());
|
||||
|
||||
steps(&mut machine, 1);
|
||||
assert_eq!(machine.get_tos(), Ok(0x31));
|
||||
steps(&mut machine, 3);
|
||||
@@ -31,6 +35,7 @@ fn task3_goto2() {
|
||||
#[test]
|
||||
fn task3_ifeq1() {
|
||||
let mut machine = rustijvm::Machine::new_from_file("files/task3/IFEQ1.ijvm").unwrap();
|
||||
machine.set_output(rustijvm::stubs::output_stub());
|
||||
|
||||
steps(&mut machine, 1);
|
||||
assert_eq!(machine.get_tos(), Ok(0x5));
|
||||
@@ -69,6 +74,8 @@ fn task3_ifeq1() {
|
||||
#[test]
|
||||
fn task3_iflt1() {
|
||||
let mut machine = rustijvm::Machine::new_from_file("files/task3/IFLT1.ijvm").unwrap();
|
||||
machine.set_output(rustijvm::stubs::output_stub());
|
||||
|
||||
let mut pc = 0;
|
||||
|
||||
// L1
|
||||
@@ -96,6 +103,8 @@ fn task3_iflt1() {
|
||||
#[test]
|
||||
fn task3_ificmpeq1() {
|
||||
let mut machine = rustijvm::Machine::new_from_file("files/task3/IFICMPEQ1.ijvm").unwrap();
|
||||
machine.set_output(rustijvm::stubs::output_stub());
|
||||
|
||||
let mut pc = 0;
|
||||
|
||||
// L1
|
||||
|
||||
Reference in New Issue
Block a user