X Tutup
Skip to content

Spread LuaPairsIterable and LuaPairsKeysIterable#1409

Merged
Perryvw merged 2 commits intomasterfrom
spread-luamap-luaset
Feb 26, 2023
Merged

Spread LuaPairsIterable and LuaPairsKeysIterable#1409
Perryvw merged 2 commits intomasterfrom
spread-luamap-luaset

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

X Tutup