Skip to content

Commit

Permalink
fix: frequency value overflow: add missing test
Browse files Browse the repository at this point in the history
  • Loading branch information
xianfeng-zhu authored and dongyuwei committed Sep 17, 2023
1 parent 5e6542f commit 05bef1a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Tests/TestConversionEngine.mm
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ - (void)testSortWordsByFrequency {
isEqualToString:@"test;testing;tests;tested;testimonials;testimony;testament;tester;testified;testers"]);
}

- (void)testSortWordsByFrequencyFromLargeNumberOfCandidates {
NSArray *words = [self.engine wordsStartsWith:@"in"];
NSArray *sorted = [self.engine sortWordsByFrequency:words];
XCTAssertTrue([[sorted objectAtIndex:0] isEqualToString:@"in"]);
}

- (void)testPhonexEncode {
JSValue *phonexFunc = self.engine.phonexEncoder;
XCTAssertTrue([[[phonexFunc callWithArguments:@[ @"test" ]] toString] isEqualToString:@"T23"]);
Expand Down

0 comments on commit 05bef1a

Please sign in to comment.