Skip to content

Spread LuaPairsIterable and LuaPairsKeysIterable #1409

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

Merged
merged 2 commits into from
Feb 26, 2023
Merged

Conversation

Perryvw
Copy link
Member

@Perryvw Perryvw commented Feb 25, 2023

Fixes #1384

Comment on lines 544 to 545
expect(result.some(([k, v]) => k === "foo" && v === "bar")).toBe(true);
expect(result.some(([k, v]) => k === "fizz" && v === "buzz")).toBe(true);
Copy link
Contributor

@hazzard993 hazzard993 Feb 26, 2023

Choose a reason for hiding this comment

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

This matcher might help here, doesn't care about the order of the outer-most array but DOES care about the order of "foo" and "bar" inside ["foo", "bar"]

Suggested change
expect(result.some(([k, v]) => k === "foo" && v === "bar")).toBe(true);
expect(result.some(([k, v]) => k === "fizz" && v === "buzz")).toBe(true);
expect(result).toContainEqual(["foo", "bar"]);
expect(result).toContainEqual(["fizz", "buzz"]);

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, didn't know about this one. That is much nicer indeed.

@Perryvw Perryvw merged commit 3b30b09 into master Feb 26, 2023
@Perryvw Perryvw deleted the spread-luamap-luaset branch February 26, 2023 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LuaSet spread iterable operation leads to runtime error
2 participants