summaryrefslogtreecommitdiff
path: root/tests/demo.c
blob: 2b874b9e0982a7cc6ff3708e479cf899044b4e90 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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);
		});
	});
});
})