X-Git-Url: https://pd.if.org/git/?p=lice;a=blobdiff_plain;f=tests%2Fcompare.c;fp=tests%2Fcompare.c;h=8ec4f9729dd63c2dd6c18d88c1ffb7f9bdac7c13;hp=0000000000000000000000000000000000000000;hb=f1abb26903687c7967cf37c3f6c830051bdeb371;hpb=bb650f4a52a456c1aa0a34508d6f3dcce58291b6 diff --git a/tests/compare.c b/tests/compare.c new file mode 100644 index 0000000..8ec4f97 --- /dev/null +++ b/tests/compare.c @@ -0,0 +1,34 @@ +// comparison + +int main(void) { + expecti(1 < 2, 1); + expecti(1 > 2, 0); + expecti(1 == 1, 1); + expecti(1 == 2, 0); + expecti(1 <= 2, 1); + expecti(2 <= 2, 1); + expecti(2 <= 1, 0); + expecti(1 >= 2, 0); + expecti(2 >= 2, 1); + expecti(2 >= 1, 1); + expecti(1 != 1, 0); + expecti(1 != 0, 1); + expecti(1.0f == 1.0f, 1); + expecti(1.0f == 2.0f, 0); + expecti(1.0f != 1.0f, 0); + expecti(1.0f != 2.0f, 1); + expecti(1.0 == 1.0f, 1); + expecti(1.0 == 2.0f, 0); + expecti(1.0 != 1.0f, 0); + expecti(1.0 != 2.0f, 1); + expecti(1.0f == 1.0, 1); + expecti(1.0f == 2.0, 0); + expecti(1.0f != 1.0, 0); + expecti(1.0f != 2.0, 1); + expecti(1.0 == 1.0, 1); + expecti(1.0 == 2.0, 0); + expecti(1.0 != 1.0, 0); + expecti(1.0 != 2.0, 1); + + return 0; +}