Skip to content

Fix array.sort compare function not working#458

Merged
Perryvw merged 3 commits intoTypeScriptToLua:masterfrom
ark120202:fix-array-sort-compare-fn
Feb 26, 2019
Merged

Fix array.sort compare function not working#458
Perryvw merged 3 commits intoTypeScriptToLua:masterfrom
ark120202:fix-array-sort-compare-fn

Conversation

@ark120202
Copy link
Copy Markdown
Contributor

No description provided.

@ark120202 ark120202 force-pushed the fix-array-sort-compare-fn branch from 4ef4aa1 to 7ebd63d Compare February 26, 2019 16:19
@TestCase('["4", "5", "3", "2", "1"]', ["1", "2", "3", "4", "5"], "Number(a) - Number(b)")
@TestCase('["4", "5", "3", "2", "1"]', ["5", "4", "3", "2", "1"], "Number(b) - Number(a)")
@Test("array.sort with compare function")
public arraySortWithCompareFunction(array: string, expected: any, compare: string): void
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.

I would prefer tests where you compare the lua result with (a, b) => array.sort(a - b) in typescript (even if that means splitting this up into multiple tests)

@Perryvw Perryvw merged commit 10002b5 into TypeScriptToLua:master Feb 26, 2019
@ark120202 ark120202 deleted the fix-array-sort-compare-fn branch November 26, 2019 08:12
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.

2 participants