aboutsummaryrefslogtreecommitdiff
path: root/tests/demo.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/demo.c')
-rw-r--r--tests/demo.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/demo.c b/tests/demo.c
new file mode 100644
index 00000000..2b874b9e
--- /dev/null
+++ b/tests/demo.c
@@ -0,0 +1,33 @@
+#include <stdio.h>
+#include "test.h"
+
+test_main("Things work", {
+ int x;
+ int y;
+ x = 1;
+ y = 2;
+ test_convey("X is one", {
+ test_assert(x == 1);
+ });
+ test_convey("Y is two", {
+ test_so(y == 2);
+ y = 3;
+ test_so(y == 3);
+ });
+
+test_convey("Bounce", {
+ test_convey("Arithmetic", {
+ test_so(y == 2);
+ test_convey("Addition", {
+ test_so(x + y == 3);
+ test_so(x + y + y == 5);
+ y = 5;
+ test_so(x + y == 6);
+ });
+ test_convey("Subtraction", {
+ test_so(x - y == -1);
+ test_so(y - x == 1);
+ });
+ });
+});
+})