Tougher tests, and test the tests.

This commit is contained in:
2018-02-14 14:51:01 +01:00
parent 2b8fa6047d
commit 498a78cd9f
3 changed files with 53 additions and 5 deletions

48
toolchain/ttest.tt Normal file
View File

@@ -0,0 +1,48 @@
// vim: ft=c
#include <ttest.h>
TEST(two_equal_ints)
{
ASSERT_EQ_INT(1, 1);
}
TEST(FAIL_two_equal_ints)
{
ASSERT_EQ_INT(2, 3);
}
TEST(two_different_ints)
{
ASSERT_NEQ_INT(2, 3);
}
TEST(FAIL_two_different_ints)
{
ASSERT_NEQ_INT(1, 1);
}
TEST(two_equal_chars)
{
ASSERT_EQ_CHR('a', 'a');
}
TEST(FAIL_two_equal_chars)
{
ASSERT_EQ_CHR('b', 'c');
}
TEST(two_different_chars)
{
ASSERT_NEQ_CHR('b', 'c');
}
TEST(FAIL_two_different_chars)
{
ASSERT_NEQ_CHR('a', 'a');
}
TEST(two_equal_strings)
{
ASSERT_EQ_STR("Hello", "Hello", 5);
}
TEST(FAIL_two_equal_strings)
{
ASSERT_EQ_STR("Hello", "World", 5);
}