Skip to content

Commit

Permalink
Updated Testcases
Browse files Browse the repository at this point in the history
  • Loading branch information
X39 committed Dec 22, 2019
1 parent 804783b commit 0717ac9
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 23 deletions.
30 changes: 16 additions & 14 deletions tests/sqf/boolean.sqf
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
[ ["assertTrue", { true }], // BOOL
["assertFalse", { false }], // BOOL
["assertException", { true == true }], // BOOL op BOOL
["assertTrue", { true isEqualTo true }], // BOOL isEqualTo BOOL
["assertTrue", { false isEqualTo false }], // BOOL isEqualTo BOOL
["assertFalse", { true isEqualTo false }], // BOOL isEqualTo BOOL
["assertFalse", { false isEqualTo true }], // BOOL isEqualTo BOOL
["assertTrue", { true && true }], // BOOL && BOOL
["assertFalse", { true && false }], // BOOL && BOOL
["assertFalse", { false && true }], // BOOL && BOOL
["assertFalse", { false && { true } }], // BOOL && CODE
["assertTrue", { false || true }], // BOOL || BOOL
["assertTrue", { false || { true } }], // BOOL || CODE
["assertFalse", { false isEqualTo true }] // BOOL isEqualTo BOOL
[ ["assertTrue", { true }], // BOOL
["assertFalse", { false }], // BOOL
["assertException", { true == true }], // BOOL op BOOL
["assertTrue", { true isEqualTo true }], // BOOL isEqualTo BOOL
["assertTrue", { false isEqualTo false }], // BOOL isEqualTo BOOL
["assertFalse", { true isEqualTo false }], // BOOL isEqualTo BOOL
["assertFalse", { false isEqualTo true }], // BOOL isEqualTo BOOL
["assertTrue", { true && true }], // BOOL && BOOL
["assertFalse", { true && false }], // BOOL && BOOL
["assertFalse", { false && true }], // BOOL && BOOL
["assertFalse", { false && { true } }], // BOOL && CODE
["assertTrue", { false || true }], // BOOL || BOOL
["assertTrue", { false || { true } }], // BOOL || CODE
["assertTrue", { !false }], // BOOL || CODE
["assertFalse", { !true }], // BOOL || CODE
["assertFalse", { false isEqualTo true }] // BOOL isEqualTo BOOL
]
18 changes: 9 additions & 9 deletions tests/sqf/while.sqf
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[ ["assertEqual", { private _i = 0; while{ false } do { _i = 1 }; _i }, 0], // while CODE do CODE: condition false
["assertIsNil", { while{ false } do {} } ], // while CODE do CODE: condition false
["assertException", { while{ } do {} } ], // while CODE do CODE: condition empty
["assertException", { while{ "" } do {} } ], // while CODE do CODE: condition not BOOL
["assertIsNil", { while{ nil } do {} } ], // while CODE do CODE: condition nil
["assertEqual", { private _i = 0; while{ _i == 0 } do { _i = 1 }; _i }, 1], // while CODE do CODE: condition true before body executed
["assertEqual", { private _i = 0; while{ _i = _i + 1; _i < 5 } do {}; _i }, 5], // while CODE do CODE: empty body
["assertEqual", { private _i = 0; while{ _i = _i + 1; _i < 5 } do { nil }; _i }, 5], // while CODE do CODE: nil body
["assertEqual", { private _i = 0; while{ _i < 5 } do { _i = _i + 1; }; _i }, 5] // while CODE do CODE: normal body
[ ["assertEqual", { private _i = 0; while { false } do { _i = 1 }; _i }, 0], // while CODE do CODE: condition false
["assertIsNil", { while { false } do {} } ], // while CODE do CODE: condition false
["assertException", { while { } do {} } ], // while CODE do CODE: condition empty
["assertException", { while { "" } do {} } ], // while CODE do CODE: condition not BOOL
["assertIsNil", { while { nil } do {} } ], // while CODE do CODE: condition nil
["assertEqual", { private _i = 0; while { _i == 0 } do { _i = 1 }; _i }, 1], // while CODE do CODE: condition true before body executed
["assertEqual", { private _i = 0; while { _i = _i + 1; _i < 5 } do {}; _i }, 5], // while CODE do CODE: empty body
["assertEqual", { private _i = 0; while { _i = _i + 1; _i < 5 } do { nil }; _i }, 5], // while CODE do CODE: nil body
["assertEqual", { private _i = 0; while { _i < 5 } do { _i = _i + 1; }; _i }, 5] // while CODE do CODE: normal body
]

0 comments on commit 0717ac9

Please sign in to comment.