summary refs log tree commit diff
path: root/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 2c40797..71c5a99 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -88,6 +88,7 @@ pub mod parser;
 #[cfg(feature = "utilities")]
 pub mod utility;
 
+pub use executor::{U16 as ExecutorU16, U32 as ExecutorU32, U8 as ExecutorU8};
 pub use lexer::{lex, OperatorCode};
 use miette::Diagnostic;
 pub use parser::{parse, Instruction};
@@ -152,8 +153,11 @@ mod tests {
 			let mut tape: Vec<u8> = vec![0; 1024];
 
 			#[allow(clippy::expect_used)]
-			utility::execute_from_file::<executor::U8>("./test_programs/hello_world.bf", &mut tape)
-				.expect("failed to run");
+			utility::execute_from_file::<executor::U8>(
+				"./test_programs/hello_world_from_hell.bf",
+				&mut tape,
+			)
+			.expect("failed to run");
 		});
 	}
 
@@ -164,7 +168,21 @@ mod tests {
 
 			#[allow(clippy::expect_used)]
 			utility::execute_from_file::<executor::U16>(
-				"./test_programs/hello_world.bf",
+				"./test_programs/hello_world_from_hell.bf",
+				&mut tape,
+			)
+			.expect("failed to run");
+		});
+	}
+
+	#[bench]
+	fn hello_world_from_hell_bench_u32(b: &mut Bencher) {
+		b.iter(|| {
+			let mut tape: Vec<u32> = vec![0; 1024];
+
+			#[allow(clippy::expect_used)]
+			utility::execute_from_file::<executor::U32>(
+				"./test_programs/hello_world_from_hell.bf",
 				&mut tape,
 			)
 			.expect("failed to run");