-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adds GCSEtest() as more GCSE compatible replacement for assert()
Fixes #26
- Loading branch information
1 parent
4807399
commit 1b9d7ed
Showing
5 changed files
with
136 additions
and
21 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,39 @@ | ||
assert( calcBoilerStatus(19, 22, 18, "OFF") == "ON", 'Boiler should turn ON when too cold.', "logic"); | ||
GCSEtest({ | ||
"text":'Boiler should turn ON when too cold.', | ||
"func": calcBoilerStatus, | ||
"type":"logic", | ||
"input_type":"valid", | ||
"inputs":[19, 22, 18, "OFF"], | ||
"expected":"ON", | ||
"task":1 | ||
}) | ||
|
||
assert( calcBoilerStatus(19, 22, 23, "ON") == "OFF", 'Boiler should turn OFF when too hot.', "logic"); | ||
GCSEtest({ | ||
"text":'Boiler should turn OFF when too hot.', | ||
"func": calcBoilerStatus, | ||
"type":"logic", | ||
"input_type":"valid", | ||
"inputs":[19, 22, 23, "ON"], | ||
"expected":"OFF", | ||
"task":2 | ||
}) | ||
|
||
assert( calcBoilerStatus(19, 22, 20, "ON") == "ON", 'Boiler should stay ON when temp is OK.', "logic"); | ||
|
||
assert( calcBoilerStatus(19, 22, 20, "OFF") == "OFF", 'Boiler should stay OFF when temp is OK.', "logic"); | ||
GCSEtest({ | ||
"text":'Boiler should stay ON when temp is OK.', | ||
"func": calcBoilerStatus, | ||
"type":"logic", | ||
"input_type":"valid", | ||
"inputs":[19, 22, 20, "ON"], | ||
"expected":"ON", | ||
"task":3 | ||
}) | ||
|
||
GCSEtest({ | ||
"text":'Boiler should stay OFF when temp is OK.', | ||
"func": calcBoilerStatus, | ||
"type":"logic", | ||
"input_type":"valid", | ||
"inputs":[19, 22, 20, "OFF"], | ||
"expected":"OFF", | ||
"task":4 | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters