[Webkit-unassigned] [Bug 152448] [iOS Simulator] js/intl-collator.html failing

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Dec 19 22:34:57 PST 2015


https://bugs.webkit.org/show_bug.cgi?id=152448

--- Comment #11 from Sukolsak Sakshuwong <sukolsak at gmail.com> ---
(In reply to comment #10)
> > "new Intl.Collator()" returns a collator with the default locale. We cannot predict the value of "new Intl.Collator().compare('a', 'A')".
> 
> We need to test that "new Intl.Collator()" works, can't just remove the test
> for this functionality.

We have tests for "new Intl.Collator()", including "shouldBe("new Intl.Collator().compare.call(null, 'a', 'b')", "-1")". We can test that because any sensible language will likely have 'a' before 'b'. It can still be wrong, but it's extremely unlikely.

Testing compare('a', 'A') with an unknown locale is harder to predict. If we do really want to test it, we could do

shouldBeTrue("var collator = new Intl.Collator(); collator.resolvedOptions().locale != 'en-US' || collator.compare.call(Intl.Collator('en', { sensitivity:'base' }), 'A', 'a') == 1");

But that's not the point of this test case, if you look at the comment above it. The point of this test case is to test that calling compare() with any "this" has no effect on it.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20151220/149e5ba7/attachment.html>


More information about the webkit-unassigned mailing list