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
use xbasic::xbasic::XBasic;

mod common;

#[test]
fn and_1() {
	common::test_program("print 3 and 4\n", "true\n");
}

#[test]
fn and_2() {
	common::test_program("print 0 and 4\n", "false\n");
}

#[test]
fn and_3() {
	common::test_program("print 4 and 0\n", "false\n");
}

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

#[test]
fn or_1() {
	common::test_program("print 3 or 4\n", "true\n");
}

#[test]
fn or_2() {
	common::test_program("print 0 or 4\n", "true\n");
}

#[test]
fn or_3() {
	common::test_program("print 0 or 0\n", "false\n");
}

#[test]
fn or_4() {
	let mut tio = common::TestIO::new("");
	{
		let mut xb = XBasic::new(&mut tio);
		assert!(xb.run("print \"test\" or 4\n").is_err());
		assert!(xb.error_handler.had_runtime_error);
		assert_eq!(
			xb.error_handler.errors,
			["[line 1] Error : Cannot cast string to boolean."]
		);
	}
	tio.check();
}