Fixed tests

pull/2/head
Mark 2023-04-10 14:02:01 -07:00
parent 3007d7f875
commit 775d85b170
Signed by: Mark
GPG Key ID: AD62BB059C2AAEE4
1 changed files with 4 additions and 2 deletions

View File

@ -10,7 +10,7 @@ fn eval_to_str(s: &str) -> Result<String, ()> {
//let out_str = g.print(); //let out_str = g.print();
return match evaluate::evaluate(g) { return match evaluate::evaluate(g) {
Ok(x) => Ok(x.to_string()), Ok(x) => Ok(x.to_string_outer()),
Err(_) => Err(()) Err(_) => Err(())
}; };
} }
@ -178,6 +178,8 @@ fn operators() {
#[test] #[test]
fn units() { fn units() {
//good_expr("4 m*s", "2 m * 2s"); //good_expr("4 m*s", "2 m * 2s");
good_expr("1 s⁻¹", "1/s");
good_expr("6 kg", "2 * 3kg");
good_expr("1 m/s", "2 m / 2s"); good_expr("1 m/s", "2 m / 2s");
good_expr("10 m", "10 m"); good_expr("10 m", "10 m");
good_expr("10 m", "10 * m"); good_expr("10 m", "10 * m");
@ -188,7 +190,7 @@ fn units() {
good_expr("2 m^2", "2m * m"); good_expr("2 m^2", "2m * m");
good_expr("1 m^2", "m m"); good_expr("1 m^2", "m m");
good_expr("2 m", "rt (4m^2)"); //good_expr("2 m", "rt (4m^2)");
bad_expr("m + s"); bad_expr("m + s");
bad_expr("m ^ s"); bad_expr("m ^ s");