crftng-intrprtrs/tests/integration_test.rs

16 lines
432 B
Rust
Raw Permalink Normal View History

2022-04-03 22:07:19 +02:00
use crftng_intrprtrs::run;
2022-04-03 21:54:39 +02:00
#[test]
fn test_one_equality() {
2022-04-29 20:00:06 +02:00
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);
2022-04-03 21:54:39 +02:00
}
fn run_check_result_eq_bool(code: &str, value: bool) {
2022-04-06 17:24:29 +02:00
assert_eq!(run(code).unwrap(), value.into())
2022-04-03 21:54:39 +02:00
}