-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added testing for pylib * run yarn format * Fixed broken test case for pylib * Updated pylib test snapshot * Use strict equality operator in pylib --------- Co-authored-by: sayomaki <[email protected]> Co-authored-by: Richard Dominick <[email protected]> Co-authored-by: Martin Henz <[email protected]>
- Loading branch information
1 parent
e1637fe
commit 8aa08d5
Showing
3 changed files
with
687 additions
and
11 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,339 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`adding an integer and a float is ok: expectResult 1`] = ` | ||
Object { | ||
"alertResult": Array [], | ||
"code": "__py_adder(1.0, BigInt(2))", | ||
"displayResult": Array [], | ||
"numErrors": 0, | ||
"parsedErrors": "", | ||
"result": 3, | ||
"resultStatus": "finished", | ||
"visualiseListResult": Array [], | ||
} | ||
`; | ||
|
||
exports[`adding two floats is ok: expectResult 1`] = ` | ||
Object { | ||
"alertResult": Array [], | ||
"code": "__py_adder(1.0, 2.0)", | ||
"displayResult": Array [], | ||
"numErrors": 0, | ||
"parsedErrors": "", | ||
"result": 3, | ||
"resultStatus": "finished", | ||
"visualiseListResult": Array [], | ||
} | ||
`; | ||
|
||
exports[`adding two integers is ok: expectResult 1`] = ` | ||
Object { | ||
"alertResult": Array [], | ||
"code": "__py_adder(BigInt(1), BigInt(2))", | ||
"displayResult": Array [], | ||
"numErrors": 0, | ||
"parsedErrors": "", | ||
"result": 3n, | ||
"resultStatus": "finished", | ||
"visualiseListResult": Array [], | ||
} | ||
`; | ||
|
||
exports[`cannot divide non-number values: expectParsedError 1`] = ` | ||
Object { | ||
"alertResult": Array [], | ||
"code": "__py_divider(\\"a\\", 2)", | ||
"displayResult": Array [], | ||
"numErrors": 1, | ||
"parsedErrors": "Line 1: Error: Expected number on left hand side of operation, got string.", | ||
"result": undefined, | ||
"resultStatus": "error", | ||
"visualiseListResult": Array [], | ||
} | ||
`; | ||
|
||
exports[`cannot floor non-number values: expectParsedError 1`] = ` | ||
Object { | ||
"alertResult": Array [], | ||
"code": "__py_floorer(\\"a\\", 2)", | ||
"displayResult": Array [], | ||
"numErrors": 1, | ||
"parsedErrors": "Line 1: Error: Expected number on left hand side of operation, got string.", | ||
"result": undefined, | ||
"resultStatus": "error", | ||
"visualiseListResult": Array [], | ||
} | ||
`; | ||
|
||
exports[`cannot mod non-number values: expectParsedError 1`] = ` | ||
Object { | ||
"alertResult": Array [], | ||
"code": "__py_modder(\\"a\\", 2)", | ||
"displayResult": Array [], | ||
"numErrors": 1, | ||
"parsedErrors": "Line 1: Error: Expected number on left hand side of operation, got string.", | ||
"result": undefined, | ||
"resultStatus": "error", | ||
"visualiseListResult": Array [], | ||
} | ||
`; | ||
|
||
exports[`cannot multiply non-number values: expectParsedError 1`] = ` | ||
Object { | ||
"alertResult": Array [], | ||
"code": "__py_multiplier(\\"a\\", 2)", | ||
"displayResult": Array [], | ||
"numErrors": 1, | ||
"parsedErrors": "Line 1: Error: Expected number on left hand side of operation, got string.", | ||
"result": undefined, | ||
"resultStatus": "error", | ||
"visualiseListResult": Array [], | ||
} | ||
`; | ||
|
||
exports[`cannot power non-number values: expectParsedError 1`] = ` | ||
Object { | ||
"alertResult": Array [], | ||
"code": "__py_powerer(\\"a\\", 2)", | ||
"displayResult": Array [], | ||
"numErrors": 1, | ||
"parsedErrors": "Line 1: Error: Expected number on left hand side of operation, got string.", | ||
"result": undefined, | ||
"resultStatus": "error", | ||
"visualiseListResult": Array [], | ||
} | ||
`; | ||
|
||
exports[`dividing float and float is ok: expectResult 1`] = ` | ||
Object { | ||
"alertResult": Array [], | ||
"code": "__py_divider(1.0, 2.0)", | ||
"displayResult": Array [], | ||
"numErrors": 0, | ||
"parsedErrors": "", | ||
"result": 0.5, | ||
"resultStatus": "finished", | ||
"visualiseListResult": Array [], | ||
} | ||
`; | ||
|
||
exports[`dividing integer and float is ok: expectResult 1`] = ` | ||
Object { | ||
"alertResult": Array [], | ||
"code": "__py_divider(BigInt(2), 1.0)", | ||
"displayResult": Array [], | ||
"numErrors": 0, | ||
"parsedErrors": "", | ||
"result": 2, | ||
"resultStatus": "finished", | ||
"visualiseListResult": Array [], | ||
} | ||
`; | ||
|
||
exports[`dividing integer and integer is ok: expectResult 1`] = ` | ||
Object { | ||
"alertResult": Array [], | ||
"code": "__py_divider(BigInt(1), BigInt(2))", | ||
"displayResult": Array [], | ||
"numErrors": 0, | ||
"parsedErrors": "", | ||
"result": 0.5, | ||
"resultStatus": "finished", | ||
"visualiseListResult": Array [], | ||
} | ||
`; | ||
|
||
exports[`flooring float and float is ok: expectResult 1`] = ` | ||
Object { | ||
"alertResult": Array [], | ||
"code": "__py_floorer(1.0, 2.0)", | ||
"displayResult": Array [], | ||
"numErrors": 0, | ||
"parsedErrors": "", | ||
"result": 0n, | ||
"resultStatus": "finished", | ||
"visualiseListResult": Array [], | ||
} | ||
`; | ||
|
||
exports[`flooring integer and float is ok: expectResult 1`] = ` | ||
Object { | ||
"alertResult": Array [], | ||
"code": "__py_floorer(BigInt(2), 1.0)", | ||
"displayResult": Array [], | ||
"numErrors": 0, | ||
"parsedErrors": "", | ||
"result": 2n, | ||
"resultStatus": "finished", | ||
"visualiseListResult": Array [], | ||
} | ||
`; | ||
|
||
exports[`flooring integer and integer is ok: expectResult 1`] = ` | ||
Object { | ||
"alertResult": Array [], | ||
"code": "__py_floorer(BigInt(2), BigInt(1))", | ||
"displayResult": Array [], | ||
"numErrors": 0, | ||
"parsedErrors": "", | ||
"result": 2n, | ||
"resultStatus": "finished", | ||
"visualiseListResult": Array [], | ||
} | ||
`; | ||
|
||
exports[`minusing an integer from a float is ok: expectResult 1`] = ` | ||
Object { | ||
"alertResult": Array [], | ||
"code": "__py_minuser(1.0, BigInt(2))", | ||
"displayResult": Array [], | ||
"numErrors": 0, | ||
"parsedErrors": "", | ||
"result": -1, | ||
"resultStatus": "finished", | ||
"visualiseListResult": Array [], | ||
} | ||
`; | ||
|
||
exports[`minusing two floats is ok: expectResult 1`] = ` | ||
Object { | ||
"alertResult": Array [], | ||
"code": "__py_minuser(1.0, 2.0)", | ||
"displayResult": Array [], | ||
"numErrors": 0, | ||
"parsedErrors": "", | ||
"result": -1, | ||
"resultStatus": "finished", | ||
"visualiseListResult": Array [], | ||
} | ||
`; | ||
|
||
exports[`minusing two integers is ok: expectResult 1`] = ` | ||
Object { | ||
"alertResult": Array [], | ||
"code": "__py_minuser(BigInt(1), BigInt(2))", | ||
"displayResult": Array [], | ||
"numErrors": 0, | ||
"parsedErrors": "", | ||
"result": -1n, | ||
"resultStatus": "finished", | ||
"visualiseListResult": Array [], | ||
} | ||
`; | ||
|
||
exports[`modding float and float is ok: expectResult 1`] = ` | ||
Object { | ||
"alertResult": Array [], | ||
"code": "__py_modder(1.0, 2.0)", | ||
"displayResult": Array [], | ||
"numErrors": 0, | ||
"parsedErrors": "", | ||
"result": 1, | ||
"resultStatus": "finished", | ||
"visualiseListResult": Array [], | ||
} | ||
`; | ||
|
||
exports[`modding integer and float is ok: expectResult 1`] = ` | ||
Object { | ||
"alertResult": Array [], | ||
"code": "__py_modder(BigInt(2), 1.0)", | ||
"displayResult": Array [], | ||
"numErrors": 0, | ||
"parsedErrors": "", | ||
"result": 0, | ||
"resultStatus": "finished", | ||
"visualiseListResult": Array [], | ||
} | ||
`; | ||
|
||
exports[`modding integer and integer is ok: expectResult 1`] = ` | ||
Object { | ||
"alertResult": Array [], | ||
"code": "__py_modder(BigInt(2), BigInt(1))", | ||
"displayResult": Array [], | ||
"numErrors": 0, | ||
"parsedErrors": "", | ||
"result": 0n, | ||
"resultStatus": "finished", | ||
"visualiseListResult": Array [], | ||
} | ||
`; | ||
|
||
exports[`multiplying float and float is ok: expectResult 1`] = ` | ||
Object { | ||
"alertResult": Array [], | ||
"code": "__py_multiplier(1.0, 2.0)", | ||
"displayResult": Array [], | ||
"numErrors": 0, | ||
"parsedErrors": "", | ||
"result": 2, | ||
"resultStatus": "finished", | ||
"visualiseListResult": Array [], | ||
} | ||
`; | ||
|
||
exports[`multiplying integer and float is ok: expectResult 1`] = ` | ||
Object { | ||
"alertResult": Array [], | ||
"code": "__py_multiplier(1.0, BigInt(2))", | ||
"displayResult": Array [], | ||
"numErrors": 0, | ||
"parsedErrors": "", | ||
"result": 2, | ||
"resultStatus": "finished", | ||
"visualiseListResult": Array [], | ||
} | ||
`; | ||
|
||
exports[`multiplying integer and integer is ok: expectResult 1`] = ` | ||
Object { | ||
"alertResult": Array [], | ||
"code": "__py_multiplier(BigInt(1), BigInt(2))", | ||
"displayResult": Array [], | ||
"numErrors": 0, | ||
"parsedErrors": "", | ||
"result": 2n, | ||
"resultStatus": "finished", | ||
"visualiseListResult": Array [], | ||
} | ||
`; | ||
|
||
exports[`powering float and float is ok: expectResult 1`] = ` | ||
Object { | ||
"alertResult": Array [], | ||
"code": "__py_powerer(1.0, 2.0)", | ||
"displayResult": Array [], | ||
"numErrors": 0, | ||
"parsedErrors": "", | ||
"result": 1, | ||
"resultStatus": "finished", | ||
"visualiseListResult": Array [], | ||
} | ||
`; | ||
|
||
exports[`powering integer and float is ok: expectResult 1`] = ` | ||
Object { | ||
"alertResult": Array [], | ||
"code": "__py_powerer(BigInt(2), 1.0)", | ||
"displayResult": Array [], | ||
"numErrors": 0, | ||
"parsedErrors": "", | ||
"result": 2, | ||
"resultStatus": "finished", | ||
"visualiseListResult": Array [], | ||
} | ||
`; | ||
|
||
exports[`powering integer and integer is ok: expectResult 1`] = ` | ||
Object { | ||
"alertResult": Array [], | ||
"code": "__py_powerer(BigInt(2), BigInt(1))", | ||
"displayResult": Array [], | ||
"numErrors": 0, | ||
"parsedErrors": "", | ||
"result": 2n, | ||
"resultStatus": "finished", | ||
"visualiseListResult": Array [], | ||
} | ||
`; |
Oops, something went wrong.