@@ -11,62 +11,22 @@ test("codepoint characters", () => {
11
11
/* "b" */ 0x0062 ,
12
12
null ,
13
13
) ;
14
- assert . strictEqual (
15
- characters . getCodePoint ( KeyModifier . None ) ,
16
- /* "a" */ 0x0061 ,
17
- ) ;
18
- assert . strictEqual (
19
- characters . getCodePoint ( KeyModifier . Shift ) ,
20
- /* "a" */ 0x0061 ,
21
- ) ;
22
- assert . strictEqual (
23
- characters . getCodePoint ( KeyModifier . Alt ) ,
24
- /* "b" */ 0x0062 ,
25
- ) ;
26
- assert . strictEqual (
27
- characters . getCodePoint ( KeyModifier . ShiftAlt ) ,
28
- /* "b" */ 0x0062 ,
29
- ) ;
30
- } ) ;
31
-
32
- test ( "dead characters" , ( ) => {
33
- const characters = new KeyCharacters (
34
- "KeyA" ,
35
- { dead : /* "*" */ 0x002a } ,
36
- { dead : /* "*" */ 0x002a } ,
37
- null ,
38
- null ,
39
- ) ;
40
- assert . strictEqual ( characters . getCodePoint ( KeyModifier . None ) , 0x0000 ) ;
41
- assert . strictEqual ( characters . getCodePoint ( KeyModifier . Shift ) , 0x0000 ) ;
42
- assert . strictEqual ( characters . getCodePoint ( KeyModifier . Alt ) , 0x0000 ) ;
43
- assert . strictEqual ( characters . getCodePoint ( KeyModifier . ShiftAlt ) , 0x0000 ) ;
14
+ assert . strictEqual ( characters . getCodePoint ( KeyModifier . None ) , 0x0061 ) ;
15
+ assert . strictEqual ( characters . getCodePoint ( KeyModifier . Shift ) , 0x0061 ) ;
16
+ assert . strictEqual ( characters . getCodePoint ( KeyModifier . Alt ) , 0x0062 ) ;
17
+ assert . strictEqual ( characters . getCodePoint ( KeyModifier . ShiftAlt ) , 0x0062 ) ;
44
18
} ) ;
45
19
46
- test ( "special characters" , ( ) => {
20
+ test ( "dead, special and ligature characters" , ( ) => {
47
21
const characters = new KeyCharacters (
48
22
"KeyA" ,
49
- { special : /* "a" */ 0x0061 } ,
50
- { special : /* "b" */ 0x0062 } ,
51
- null ,
52
- null ,
53
- ) ;
54
- assert . strictEqual ( characters . getCodePoint ( KeyModifier . None ) , 0x0000 ) ;
55
- assert . strictEqual ( characters . getCodePoint ( KeyModifier . Shift ) , 0x0000 ) ;
56
- assert . strictEqual ( characters . getCodePoint ( KeyModifier . Alt ) , 0x0000 ) ;
57
- assert . strictEqual ( characters . getCodePoint ( KeyModifier . ShiftAlt ) , 0x0000 ) ;
58
- } ) ;
59
-
60
- test ( "ligature characters" , ( ) => {
61
- const characters = new KeyCharacters (
62
- "KeyA" ,
63
- { ligature : "XX" } ,
64
- { ligature : "YY" } ,
65
- null ,
66
- null ,
67
- ) ;
68
- assert . strictEqual ( characters . getCodePoint ( KeyModifier . None ) , 0x0000 ) ;
69
- assert . strictEqual ( characters . getCodePoint ( KeyModifier . Shift ) , 0x0000 ) ;
70
- assert . strictEqual ( characters . getCodePoint ( KeyModifier . Alt ) , 0x0000 ) ;
71
- assert . strictEqual ( characters . getCodePoint ( KeyModifier . ShiftAlt ) , 0x0000 ) ;
23
+ /* "a" */ 0x0061 ,
24
+ { dead : /* COMBINING GRAVE ACCENT */ 0x0300 } ,
25
+ { special : /* ZERO WIDTH NON-JOINER */ 0x200c } ,
26
+ { ligature : "XYZ" } ,
27
+ ) ;
28
+ assert . strictEqual ( characters . getCodePoint ( KeyModifier . None ) , 0x0061 ) ;
29
+ assert . strictEqual ( characters . getCodePoint ( KeyModifier . Shift ) , null ) ;
30
+ assert . strictEqual ( characters . getCodePoint ( KeyModifier . Alt ) , null ) ;
31
+ assert . strictEqual ( characters . getCodePoint ( KeyModifier . ShiftAlt ) , null ) ;
72
32
} ) ;
0 commit comments