Skip to content

Commit

Permalink
Add some missing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
irh committed Jan 5, 2023
1 parent a7e7065 commit f10809f
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion src/runtime/tests/external_value_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,17 @@ x.to_number()
test_script_with_external_value(script, 66);
}

#[test]
fn subtract_assign() {
let script = "
x = make_external 42
x -= make_external 20
x -= 2
x.to_number()
";
test_script_with_external_value(script, 20);
}

#[test]
fn multiply_assign() {
let script = "
Expand All @@ -287,7 +298,27 @@ x.to_number()
test_script_with_external_value(script, 99);
}

// TODO missing tests
#[test]
fn divide_assign() {
let script = "
x = make_external 99
x /= make_external 3
x /= 3
x.to_number()
";
test_script_with_external_value(script, 11);
}

#[test]
fn remainder_assign() {
let script = "
x = make_external 99
x %= make_external 90
x %= 5
x.to_number()
";
test_script_with_external_value(script, 4);
}

#[test]
fn less() {
Expand Down

0 comments on commit f10809f

Please sign in to comment.