summaryrefslogtreecommitdiff
path: root/example
diff options
context:
space:
mode:
authorsanine <sanine.not@pm.me>2022-12-21 20:11:30 -0600
committersanine <sanine.not@pm.me>2022-12-21 20:11:30 -0600
commit423082adc4b8d0e8964ca73e79ed7d9ac8b391a3 (patch)
tree7842320ed549e6487daa4c14070cfd2416e8731a /example
parent182b4002e63f330de6150e160a1ad23b1e6b33b8 (diff)
add example
Diffstat (limited to 'example')
-rw-r--r--example/sum.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/example/sum.c b/example/sum.c
new file mode 100644
index 0000000..d9d1221
--- /dev/null
+++ b/example/sum.c
@@ -0,0 +1,29 @@
+#define LILY_IMPLEMENTATION
+#include "lily-test.h"
+
+int sum(int a, int b)
+{
+ return 0;
+}
+
+
+LILY_FILE_BEGIN(sum_suite)
+
+LILY_TEST("sums are correct")
+{
+ CHECK_EQ(sum(0, 0), 0, "%d");
+ CHECK_EQ(sum(1, 0), 1, "%d");
+ INFO("this is some info");
+ CHECK_EQ(sum(2, 2), 4, "%d");
+}
+#include LILY_PUSH_TEST()
+
+#define LILY_FILE_END
+#include LILY_REGISTER_TESTS()
+
+
+int main()
+{
+ sum_suite();
+ return 0;
+}