diff options
Diffstat (limited to 'test/run_tests.cpp')
| -rw-r--r-- | test/run_tests.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/test/run_tests.cpp b/test/run_tests.cpp index e7729e5a42..8fd17c4d1a 100644 --- a/test/run_tests.cpp +++ b/test/run_tests.cpp @@ -569,6 +569,11 @@ export fn main(argc : isize, argv : &&u8, env : &&u8) -> i32 { foo.a += 1; foo.b = foo.a == 1; test_foo(foo); + test_mutation(&foo); + if foo.c != 100 { + print_str("BAD\n"); + } + print_str("OK\n"); return 0; } struct Foo { @@ -577,10 +582,13 @@ struct Foo { c : f32, } fn test_foo(foo : Foo) { - if foo.b { - print_str("OK\n"); + if !foo.b { + print_str("BAD\n"); } } +fn test_mutation(foo : &Foo) { + foo.c = 100; +} )SOURCE", "OK\n"); add_simple_case("global variables", R"SOURCE( |
