diff options
Diffstat (limited to 'tests/demo.c')
| -rw-r--r-- | tests/demo.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/demo.c b/tests/demo.c index 9ff70727..e831109a 100644 --- a/tests/demo.c +++ b/tests/demo.c @@ -62,4 +62,33 @@ test_main_group({ test_so(x == 1); }); }); + + test_group("Reset group", { + static int x = 0; + static int y = 0; + test_reset({ + x = 20; + }); + test_convey("Add one to both y and x", { + x++; + y++; + test_so(x == 1); /* no reset yet */ + test_so(y == 1); + }); + test_convey("Again", { + x++; + y++; + test_so(x == 21); + test_so(y == 2); + }); + test_convey("Third time", { + x++; + y++; + test_so(x == 21); + test_so(y == 3); + }); + + test_so(x == 20); + test_so(y == 3); + }); }) |
