mirror of
https://github.com/RevCurtisP/C02.git
synced 2024-11-25 06:31:25 +00:00
60 lines
2.2 KiB
Plaintext
60 lines
2.2 KiB
Plaintext
/****************************************
|
|
* CONDS - Test Conditional Expressions *
|
|
****************************************/
|
|
|
|
//Specify System Header using -H option
|
|
|
|
char allok;
|
|
|
|
void passed() {putstr(" PASS");}
|
|
void passln() {passed(); newlin();}
|
|
void failed() {putstr(" FAIL"); allok = $00;}
|
|
void failln() {failed(); newlin();}
|
|
|
|
main:
|
|
|
|
allok = $FF; //TRUE
|
|
|
|
putstr("TEST CONDITIONALS"); newlin();
|
|
|
|
putstr(" 1<>1"); if (1<>1) failed(); else passed();
|
|
putstr(" 1<>2"); if (1<>2) passln(); else failln();
|
|
putstr(" 1==1"); if (1==1) passed(); else failed();
|
|
putstr(" 1==2"); if (1==2) failln(); else passln();
|
|
putstr("1+1=2"); if (1+1 == 2) passed(); else failed();
|
|
putstr(" 2<1"); if (2<1) failln(); else passln();
|
|
putstr(" 1<1"); if (1<1) failed(); else passed();
|
|
putstr(" 1<2"); if (1<2) passln(); else failln();
|
|
|
|
putstr(" 1<=1"); if (1<=1) passed(); else failed();
|
|
putstr(" 1<=2"); if (1<=2) passln(); else failln();
|
|
putstr(" 2<=1"); if (2<=1) failed(); else passed();
|
|
putstr(" 2>1"); if (2>1) passln(); else failln();
|
|
putstr(" 1>1"); if (1>1) failed(); else passed();
|
|
putstr(" 1>2"); if (1>2) failln(); else passln();
|
|
putstr(" 1>=1"); if (1>=1) passed(); else failed();
|
|
putstr(" 1>=2"); if (1>=2) failln(); else passln();
|
|
putstr(" 2>=1"); if (2>=1) passed(); else failed();
|
|
putstr(" !0:+"); if (!0:+) failln(); else passln();
|
|
|
|
putstr("$FF:+"); if ($FF:+) failed(); else passed();
|
|
putstr(" $FF"); if ($FF) passln(); else failln();
|
|
putstr("$FF:-"); if ($FF:-) passed(); else failed();
|
|
putstr(" !$FF"); if (!$FF) failln(); else passln();
|
|
putstr("$00:+"); if ($00:+) passed(); else failed();
|
|
putstr(" $00"); if ($00) failln(); else passln();
|
|
putstr("$00:-"); if ($00:-) failed(); else passed();
|
|
putstr(" !$00"); if (!$00) passln(); else failln();
|
|
|
|
putstr(" 1!0"); if (1|0) passed(); else failed();
|
|
putstr(" !1!0"); if (!1|0) failln(); else passln();
|
|
putstr(" 1&0"); if (1&0) failed(); else passed();
|
|
putstr(" !1&0"); if (!1&0) passln(); else failln();
|
|
putstr(" 1^1"); if (1^1) failed(); else passed();
|
|
putstr(" !1^1"); if (!1^1) passln(); else failln();
|
|
|
|
if (allok) putstr("ALL TESTS PASSED"); newlin();
|
|
getchr();
|
|
goto exit;
|
|
|