Skip to content

Tests for NumericSeparatorLiteral. Closes gh-1051#1176

Merged
leobalter merged 3 commits into
tc39:masterfrom
rwaldron:1051
Aug 21, 2017
Merged

Tests for NumericSeparatorLiteral. Closes gh-1051#1176
leobalter merged 3 commits into
tc39:masterfrom
rwaldron:1051

Conversation

@rwaldron

Copy link
Copy Markdown
Contributor

No description provided.

@leobalter leobalter left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few comments. The tests are good!

I love the file names, it took me less than a minute to read them properly.

One thing I imagined for this is something checking whitespaces including line terminators, like:

1
_
1

on this case, the return of that - in an expression - is 1, and we can have _ with a defined accessor desc to verify the access.

what do you think? too weird?

assert.sameValue(0b0_1, 0b01);
assert.sameValue(0b0_1, 0b01);
assert.sameValue(0b0_1, 0b01);
assert.sameValue(0b0_1, 0b01);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stress tests? :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol @ me


---*/

assert.sameValue(0b0_1, 0b01);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't this the same as in test/language/literals/numeric/numeric-separator-literal-bil-bd-nsl-bd-one-of.js?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

assert.sameValue(1_8, 18);
assert.sameValue(1_9, 19);


Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

while you're fixing the other parts, you may want to remove this extra line.


---*/

assert.sameValue(1_0, 10);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this case already exists in other files. I don't mind, but if the idea is testing one of, it would nice to add more assertions in this same file for:

2_1, 2_3, 2_4...
3_1, 3_2, 3_4...
...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No thanks ❤️

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you're welcome ❤️


/*---
esid: prod-NumericLiteralSeparator
description: description: NumericLiteralSeparator may not appear adjacent to another NumericLiteralSeparator in a BinaryIntegerLiteral

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

description description


/*---
esid: prod-NumericLiteralSeparator
description: `.` DecimalDigit NumericLiteralSeparator DecimalDigit ExponentPart_opt

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrap the value with quotes, otherwise the yaml will fail parsing

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same for other cases here with

description: `


/*---
esid: prod-NumericLiteralSeparator
description: description: NumericLiteralSeparator may not appear adjacent to another NumericLiteralSeparator in a OctalIntegerLiteral

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a profound description

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol

@rwaldron rwaldron force-pushed the 1051 branch 2 times, most recently from d6f022f to e6b429c Compare August 15, 2017 20:24
@rwaldron rwaldron added the awaiting stage 2.7 Supports a "Stage 2" feature label Aug 21, 2017
@leobalter

Copy link
Copy Markdown
Member

We've got a few frontmatter linting bugs.

test/built-ins/parseFloat/tonumber-numeric-separator-literal-bil-bd-nsl-bd.js: FRONTMATTER - No valid YAML-formatted frontmatter
test/built-ins/parseFloat/tonumber-numeric-separator-literal-hil-hd-nsl-hd.js: FRONTMATTER - Required fields missing: description
test/built-ins/parseFloat/tonumber-numeric-separator-literal-dd-dot-dd-ep-sign-plus-dd-nsl-dd.js: FRONTMATTER - Required fields missing: description
test/built-ins/parseFloat/tonumber-numeric-separator-literal-oil-ods-nsl-od.js: FRONTMATTER - Required fields missing: description
test/built-ins/parseFloat/tonumber-numeric-separator-literal-hil-hds-nsl-hd.js: FRONTMATTER - Required fields missing: description
test/built-ins/parseFloat/tonumber-numeric-separator-literal-nzd-nsl-dd-one-of.js: FRONTMATTER - No valid YAML-formatted frontmatter
test/built-ins/parseFloat/tonumber-numeric-separator-literal-oil-ods-nsl-ods.js: FRONTMATTER - Required fields missing: description
test/built-ins/parseFloat/tonumber-numeric-separator-literal-oil-od-nsl-od.js: FRONTMATTER - Required fields missing: description
test/built-ins/parseFloat/tonumber-numeric-separator-literal-dot-dds-nsl-dd-ep.js: FRONTMATTER - Required fields missing: description
test/built-ins/parseFloat/tonumber-numeric-separator-literal-sign-minus-dds-nsl-dd.js: FRONTMATTER - Required fields missing: description
test/built-ins/parseFloat/tonumber-numeric-separator-literal-oil-od-nsl-ods.js: FRONTMATTER - Required fields missing: description
test/built-ins/parseFloat/tonumber-numeric-separator-literal-dot-dd-nsl-dds-ep.js: FRONTMATTER - Required fields missing: description
test/built-ins/parseFloat/tonumber-numeric-separator-literal-nzd-nsl-dds.js: FRONTMATTER - Required fields missing: description
test/built-ins/parseFloat/tonumber-numeric-separator-literal-dd-dot-dd-ep-sign-plus-dds-nsl-dd.js: FRONTMATTER - Required fields missing: description
test/built-ins/parseFloat/tonumber-numeric-separator-literal-hil-od-nsl-od-one-of.js: FRONTMATTER - Required fields missing: description
test/built-ins/parseFloat/tonumber-numeric-separator-literal-dd-dot-dd-ep-sign-minus-dds-nsl-dd.js: FRONTMATTER - Required fields missing: description
test/built-ins/parseFloat/tonumber-numeric-separator-literal-bil-bd-nsl-bds.js: FRONTMATTER - Required fields missing: description
test/built-ins/parseFloat/tonumber-numeric-separator-literal-bil-bds-nsl-bds.js: FRONTMATTER - Required fields missing: description
test/built-ins/parseFloat/tonumber-numeric-separator-literal-sign-plus-dds-nsl-dd.js: FRONTMATTER - Required fields missing: description
test/built-ins/parseFloat/tonumber-numeric-separator-literal-hil-hd-nsl-hds.js: FRONTMATTER - Required fields missing: description
test/built-ins/parseFloat/tonumber-numeric-separator-literal-nzd-nsl-dd.js: FRONTMATTER - Required fields missing: description
test/built-ins/parseFloat/tonumber-numeric-separator-literal-dd-nsl-dd-one-of.js: FRONTMATTER - Required fields missing: description
test/built-ins/parseFloat/tonumber-numeric-separator-literal-dds-nsl-dd.js: FRONTMATTER - Required fields missing: description
test/built-ins/parseFloat/tonumber-numeric-separator-literal-dot-dds-nsl-dds-ep.js: FRONTMATTER - Required fields missing: description
test/built-ins/parseFloat/tonumber-numeric-separator-literal-dds-dot-dd-nsl-dd-ep-dd.js: FRONTMATTER - Required fields missing: description
test/built-ins/parseFloat/tonumber-numeric-separator-literal-oil-od-nsl-od-one-of.js: FRONTMATTER - Required fields missing: description
test/built-ins/parseFloat/tonumber-numeric-separator-literal-dot-dd-nsl-dd-ep.js: FRONTMATTER - Required fields missing: description
test/built-ins/parseFloat/tonumber-numeric-separator-literal-dd-dot-dd-ep-sign-minus-dd-nsl-dd.js: FRONTMATTER - Required fields missing: description
test/built-ins/parseFloat/tonumber-numeric-separator-literal-hil-hds-nsl-hds.js: FRONTMATTER - Required fields missing: description
test/built-ins/parseFloat/tonumber-numeric-separator-literal-bil-bds-nsl-bd.js: FRONTMATTER - Required fields missing: description

@leobalter

Copy link
Copy Markdown
Member

Thanks for adding the stage 3 label, I thought it was already on Stage 3 and almost merged this.

@rwaldron

Copy link
Copy Markdown
Contributor Author

Fixes to frontmatter pushed

@leobalter

Copy link
Copy Markdown
Member

@rwaldron can you open a new PR with these commits? I clicked the merge button too early.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting stage 2.7 Supports a "Stage 2" feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants