From 131386632f85c5e66359b9553ad811d54436e479 Mon Sep 17 00:00:00 2001 From: 0x4261756D <–38735823+0x4261756D@users.noreply.github.com> Date: Mon, 23 Jan 2023 06:08:26 +0100 Subject: [PATCH] Fix tests --- src/main.rs | 8 ++++---- tests/basic_import.qbl | 3 +++ tests/recursive_import.qbl | 3 ++- tests/recursive_import_2.qbl | 6 +++++- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/main.rs b/src/main.rs index a02e241..cc63a0c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -986,12 +986,12 @@ fn interpret_program(operations: &Vec, queue: &mut Vec, funct if position >= arr.length { //return Err(format!("Attempted an out of bounds write for array {} ({} >= {}) at {}:{}", arr.name, position, arr.length, line, col)); - return Err(String::from("Attempted array out-of-bounds access")); + return Err(String::from("Attempted array out-of-bounds access\n")); } if position < 0 { //return Err(format!("Attempted an out of bounds write for array {} ({} < 0) at {}:{}", arr.name, position, line, col)); - return Err(String::from("Attempted array out-of-bounds access")); + return Err(String::from("Attempted array out-of-bounds access\n")); } let data = queue.remove(0); if debug @@ -1010,12 +1010,12 @@ fn interpret_program(operations: &Vec, queue: &mut Vec, funct if position >= arr.length { //return Err(format!("Attempted an out of bounds read for array {} ({} >= {}) at {}:{}", arr.name, position, arr.length, line, col)); - return Err(String::from("Attempted array out-of-bounds access")); + return Err(String::from("Attempted array out-of-bounds access\n")); } if position < 0 { //return Err(format!("Attempted an out of bounds read for array {} ({} < 0) at {}:{}", arr.name, position, line, col)); - return Err(String::from("Attempted array out-of-bounds access")); + return Err(String::from("Attempted array out-of-bounds access\n")); } queue.push(arr.data[position as usize].clone()); } diff --git a/tests/basic_import.qbl b/tests/basic_import.qbl index 08b46f5..035e5dd 100644 --- a/tests/basic_import.qbl +++ b/tests/basic_import.qbl @@ -1,3 +1,6 @@ +//valid,true +//:END: + import "../std.qbl" true boolToStr println diff --git a/tests/recursive_import.qbl b/tests/recursive_import.qbl index 14e67c1..15eb82f 100644 --- a/tests/recursive_import.qbl +++ b/tests/recursive_import.qbl @@ -1,7 +1,8 @@ +//valid,:END: import "recursive_import_2.qbl" import "recursive_import.qbl" function => test { - + "test" println } \ No newline at end of file diff --git a/tests/recursive_import_2.qbl b/tests/recursive_import_2.qbl index 02d4a9a..87de355 100644 --- a/tests/recursive_import_2.qbl +++ b/tests/recursive_import_2.qbl @@ -1 +1,5 @@ -import "recursive_import.qbl" \ No newline at end of file +//valid,test +//:END: +import "recursive_import.qbl" + +test \ No newline at end of file