crftng-intrprtrs/tests/integration_test.rs
2022-04-29 20:00:06 +02:00

15 lines
432 B
Rust

use crftng_intrprtrs::run;
#[test]
fn test_one_equality() {
run_check_result_eq_bool("1 == 1;", true);
run_check_result_eq_bool("1 >= 1;", true);
run_check_result_eq_bool("1 <= 1;", true);
run_check_result_eq_bool("1 != 1;", false);
run_check_result_eq_bool("1 > 1;", false);
run_check_result_eq_bool("1 < 1;", false);
}
fn run_check_result_eq_bool(code: &str, value: bool) {
assert_eq!(run(code).unwrap(), value.into())
}