xbasic 0.3.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 uninitialized_variable() {
	common::test_program("print a\n", "0\n");
}

#[test]
fn initialized_variable() {
	common::test_program("a = 3\nprint a\n", "3\n");
}

#[test]
fn variable_persists_runs() {
	let tio = common::TestIO::new("3\n");
	let mut xb = XBasic::new(tio);
	assert!(xb.run("a = 3\n").is_ok());
	assert!(xb.run("true and \"hi\"").is_err());
	xb.clear_errors();
	assert!(xb.run("print a\n").is_ok());
	xb.get_io().check();
}

#[test]
fn mutable_variable() {
	common::test_program("a = 3\nprint a\na = 5\nprint a\n", "3\n5\n");
}

#[test]
fn z_in_identifier() {
	common::test_program("Z = 3\nprint Z\nZ = 5\nprint Z\n", "3\n5\n");
}