Add a Unicode test to RexBench that matches non-BMP characters
authormsaboff@apple.com <msaboff@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 Aug 2017 00:56:59 +0000 (00:56 +0000)
committermsaboff@apple.com <msaboff@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 Aug 2017 00:56:59 +0000 (00:56 +0000)
commit03ee1671e4998efeb6a6545cd8ddd0f21cb82241
tree48e1e181a9deb765d441c0e4727da8635f57b4c8
parentdec035f89730a6ab6e2613fb57a9c8e4b78d00d0
Add a Unicode test to RexBench that matches non-BMP characters
https://bugs.webkit.org/show_bug.cgi?id=175697

Reviewed by JF Bastien.

Added a new sub test that simulates 5 card stud poker.  This test uses the Unicode playing
cards code points, U+1F0A1..U+1F0DE, as the card representation.  The scoring of hands is
done using three regular expressions, one to check for a flush, one to check for straights
and one to check for pairs, three of a kind and four of a kind.

* RexBench/UniPoker: Added.
* RexBench/UniPoker/benchmark.js: Added.
(UniPokerBenchmark):
(UniPokerBenchmark.prototype.setup.):
(UniPokerBenchmark.prototype.setup.Math.random):
(UniPokerBenchmark.prototype.setup):
(UniPokerBenchmark.prototype.runOnce):
(UniPokerBenchmark.prototype.validate):
* RexBench/UniPoker/expected.js: Added.
(PlayerExpectation):
(PlayerExpectation.prototype.validate):
* RexBench/UniPoker/poker.js: Added.
(CardDeck):
(CardDeck.prototype.newDeck):
(CardDeck.prototype.shuffle):
(CardDeck.prototype.dealOneCard):
(CardDeck.cardRank):
(CardDeck.cardName):
(Hand):
(Hand.prototype.clear):
(Hand.prototype.takeCard):
(Hand.prototype.score):
(Hand.prototype.get rank):
(Hand.prototype.toString):
(Player):
(Player.prototype.scoreHand):
(Player.prototype.wonHand):
(Player.prototype.get name):
(Player.prototype.get hand):
(Player.prototype.get wins):
(Player.prototype.get handTypeCounts):
(playHands):
* RexBench/about.html:
* RexBench/cli.js:
* RexBench/glue.js:
(driver.reportResult):
* RexBench/index.html:
* RexBench/unipoker_benchmark.js: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220893 268f45cc-cd09-0410-ab3c-d52691b4dbfc
PerformanceTests/ChangeLog
PerformanceTests/RexBench/UniPoker/benchmark.js [new file with mode: 0644]
PerformanceTests/RexBench/UniPoker/expected.js [new file with mode: 0644]
PerformanceTests/RexBench/UniPoker/poker.js [new file with mode: 0644]
PerformanceTests/RexBench/about.html
PerformanceTests/RexBench/cli.js
PerformanceTests/RexBench/glue.js
PerformanceTests/RexBench/index.html
PerformanceTests/RexBench/unipoker_benchmark.js [new file with mode: 0644]