-
Notifications
You must be signed in to change notification settings - Fork 472
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
[test262] Add staging tests for isSubsetOf set method #3965
Conversation
This CL adds three tests to staging directory of test262. Bug: v8:13556 Change-Id: Id6e468a0fa29528350a10c94e9dd19c2835788e8 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5055866 Reviewed-by: Liviu Rau <[email protected]> Commit-Queue: Liviu Rau <[email protected]> Cr-Commit-Position: refs/heads/main@{#91139}
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.
These tests pass on my spec-implemented polyfill; LGTM pending comments
features: [set-methods] | ||
---*/ | ||
|
||
const SetLike = { |
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.
const SetLike = { | |
const setLike = { |
capitalized things are constructors
firstSet.add(43); | ||
firstSet.add(45); | ||
|
||
assert.sameValue(firstSet.isSubsetOf(SetLike), 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.
assert.sameValue(firstSet.isSubsetOf(SetLike), false); | |
assert.sameValue(firstSet.isSubsetOf(setLike), false); |
const otherSet = new Set(); | ||
otherSet.add(42); | ||
otherSet.add(43); | ||
otherSet.add(47); |
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.
const otherSet = new Set(); | |
otherSet.add(42); | |
otherSet.add(43); | |
otherSet.add(47); | |
const otherSet = new Set([42, 43, 47]); |
const firstSet = new Set(); | ||
firstSet.add(42); | ||
firstSet.add(43); |
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.
const firstSet = new Set(); | |
firstSet.add(42); | |
firstSet.add(43); | |
const firstSet = new Set([42, 43]); |
const firstSet = new Set(); | ||
firstSet.add(42); | ||
firstSet.add(43); | ||
firstSet.add(45); |
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.
const firstSet = new Set(); | |
firstSet.add(42); | |
firstSet.add(43); | |
firstSet.add(45); | |
const firstSet = new Set([42, 43, 45]); |
const firstSet = new Set(); | ||
firstSet.add(42); | ||
firstSet.add(43); | ||
firstSet.add(44); |
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.
const firstSet = new Set(); | |
firstSet.add(42); | |
firstSet.add(43); | |
firstSet.add(44); | |
const firstSet = new Set([42, 43, 44]); |
return [1, 2, 3, 4, 5].keys(); | ||
}, | ||
has(key) { | ||
if (key == 42) { |
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.
if (key == 42) { | |
if (key === 42) { |
return this.arr[Symbol.iterator](); | ||
}, | ||
has(key) { | ||
return this.arr.indexOf(key) != -1; |
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.
return this.arr.indexOf(key) != -1; | |
return this.arr.indexOf(key) !== -1; |
@ljharb We're trialing the 2-way sync bot for test262 export, and handling upstream change requests in the auto-generated PR adds a lot of complication that's out of scope. We'll work on adding some notice that these PRs are auto-generated and to comment on the upstream CL. In the meantime, I suggest the following workflows:
WDYT? |
I can certainly try it, but that feels like a bit outsized of an ask. If the bot's PRs aren't meant to be reviewed (and are in fact trusted in that sense), why are they PRs at all as opposed to just pushing commits? Can't the bot notify the v8 author that there's comments, so they can make the changes in the CL? |
Indeed they are trusted in that sense: they are merged once the upstream CL is reviewed by an engine implementer. They might be better fit as commits, which is what I think the WPT bot does. We can change it to that to avoid this workflow awkwardness.
Edit edit: Actually I was totally wrong, all the export bots do create PRs, see e.g. this one. Though I don't think any of them re-imports review comments. I think consistency here would be good.
Yes, though recall the goal here is to simplify V8 developers' test workflows to incentivize writing test262 tests directly instead of our engine-specific tests by making test262 part of the existing feature development workflow. The additional step of "also check and apply GH PR reviews" goes against that goal. |
Okay, given the nature of all the export bots creating PRs, and that the export workflow is more of a one-way export workflow instead of a bidirectional flow, my suggestion is (2) above: change it in follow-ups. Since these are staging tests, and are going to be authored by engine implementers, I suspect they will always be stylistically different than the non-staging tests. It's probably more fruitful to review at "graduation" time, when we try to move these into the main trunk, than ad-hoc review at export time. |
dismissing the block, since all changes requested are nits that can be done in a followup
I agree, reviewing at "graduation" time seems more in line with the philosophy we decided on for staging. I also agree with Jordan that it'd be fine for the bot to just push the commit, but opening a PR is fine with me too and maybe is better for visibility. |
This CL adds three tests to staging directory of test262.
Bug: v8:13556
Change-Id: Id6e468a0fa29528350a10c94e9dd19c2835788e8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5055866
Reviewed-by: Liviu Rau <[email protected]>
Commit-Queue: Liviu Rau <[email protected]>
Cr-Commit-Position: refs/heads/main@{#91139}