mirror of
https://github.com/keycastr/keycastr.git
synced 2026-05-15 06:06:06 -06:00
Add test cases for a couple special cases (tab and shift-tab)
This commit is contained in:
parent
ae5b6dd022
commit
6149ffa4af
1 changed files with 16 additions and 0 deletions
|
|
@ -206,4 +206,20 @@
|
|||
XCTSkip(@"Pending...");
|
||||
}
|
||||
|
||||
#pragma mark - Special Cases
|
||||
|
||||
- (void)test_tabKey {
|
||||
// tab characters and charactersIgnoringModifiers fields are UTF8 "\t"
|
||||
KCKeystroke *keystroke = [self keystrokeWithKeyCode:48 modifiers:256 characters:@"\t" charactersIgnoringModifiers:@"\t"];
|
||||
XCTAssertTrue([[keystroke convertToString] isEqualToString:@"\xe2\x87\xa5"]);
|
||||
}
|
||||
|
||||
- (void)test_shiftTab {
|
||||
// shift-tab characters and charactersIgnoringModifiers fields are UTF8 "\U00000019"
|
||||
// it is not possble use Objective-C @ literals with \U000000xx syntax for many 2 byte ASCII characters
|
||||
// https://stackoverflow.com/a/27697100
|
||||
KCKeystroke *keystroke = [self keystrokeWithKeyCode:48 modifiers:131330 characters:[NSString stringWithFormat:@"%C", 0x00000019] charactersIgnoringModifiers:[NSString stringWithFormat:@"%C", 0x00000019]];
|
||||
XCTAssertTrue([[keystroke convertToString] isEqualToString:@"\xe2\x87\xa4"]);
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue