New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#134 - Test all binary expression compiler #170
#134 - Test all binary expression compiler #170
Conversation
- Removed an unused import of: ParameterDeclaration Resolve neo-one-suite#144 BinaryExpressionCompiler.ts Added code for instanceOf BinaryExpressionCompiler.ts Added test for instanceof
In BinaryExpressionCompiler.test.js: Added labels for tests for easy mapping to tested feature Added tests for all current BinaryExpressions in BinaryExpressionCompiler.js - Skipped failing tests for unsupported or features with bugs EqualsEqualsKeyword (Issue neo-one-suite#170) Adjusted indenting for all tests to be the same In BinaryExpressionCompiler.js: Added Comments describing tested or not tested
…ll_BinaryExpressionCompiler adding files that were not added in last commit
if (4 / 2 !== 2) { | ||
throw 'Failure'; | ||
} | ||
if (! ((128 >> 2) == 32) ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: remove the extra space after !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here and throughout the file
|
||
test('(6 & 5) === 4 [AmpersandToken]', async () => { | ||
await helpers.executeString(` | ||
if (!(6 & 5) === 4) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you need to add parentheses: !((6 & 5) === 4)
. Makes it clearer anyways. Or just use !==
.
`); | ||
}); | ||
|
||
test('(127 ^ -6) === -123 [CaretToken]', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this is failing in CI.
|
||
test('! (0 === null) [EqualsEqualsEqualsToken]', async () => { | ||
await helpers.executeString(` | ||
if (0 === null ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: remove extra space before )
|
||
test('0 === false [EqualsEqualsEqualsToken]', async () => { | ||
await helpers.executeString(` | ||
if ( 0 === false ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: remove extra spacing in parentheses
@@ -91,9 +91,11 @@ export default class BinaryExpressionCompiler extends NodeCompiler< | |||
const pushValueOptions = sb.pushValueOptions(options); | |||
switch (kind) { | |||
case SyntaxKind.EqualsToken: | |||
// Tested |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a huge fan of these comments, but since we can't really get code coverage reports it's probably better to leave them in.
…ll_BinaryExpressionCompiler
Requirements
Create tests for all BinaryExpressions in BinaryExpressionCompiler.js
Description of the Change
In BinaryExpressionCompiler.test.js:
Added tests for all binary expressions.
Features that are not supported are skipped
Added tests for all Binary Expressions.
In BinaryExpressionCompiler.js:
Variations of an expression or default cases that are not tested are marked with a "Not Tested" comment.
Test Plan
These are the unit tests.
Alternate Designs
None, followed existing pattern for tests.
Benefits
Most all variations of binary expressions are covered.
Possible Drawbacks
More tests results in longer test times.
Applicable Issues
Created Issue#170 for EqualsEqualsToken
This resolves Issue #134