xbasic 0.1.1

A library that allows adding a scripting language onto your project with ease. This lets your users write their own arbitrary logic.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use xbasic::xbasic::XBasic;

mod common;

#[test]
fn runtime_line_count() {
	let mut tio = common::TestIO::new("hello world\n");
	{
		let mut xb = XBasic::new(&mut tio);
		assert!(xb.run("print \"hello world\"\n\"what\" and 3\n").is_err());
		assert!(xb.error_handler.had_runtime_error);
		assert_eq!(
			xb.error_handler.errors,
			["[line 2] Error : Cannot cast string to boolean."]
		);
	}
	tio.check();
}