@@ -15,6 +15,7 @@ public function testWhenCharacterIsAControl() : void
15
15
$ char = new InputCharacter ("\n" );
16
16
17
17
self ::assertTrue ($ char ->isControl ());
18
+ self ::assertTrue ($ char ->isHandledControl ());
18
19
self ::assertFalse ($ char ->isNotControl ());
19
20
self ::assertEquals ('ENTER ' , $ char ->getControl ());
20
21
self ::assertEquals ("\n" , $ char ->get ());
@@ -26,6 +27,7 @@ public function testWhenCharacterIsNotAControl() : void
26
27
$ char = new InputCharacter ('p ' );
27
28
28
29
self ::assertFalse ($ char ->isControl ());
30
+ self ::assertFalse ($ char ->isHandledControl ());
29
31
self ::assertTrue ($ char ->isNotControl ());
30
32
self ::assertEquals ('p ' , $ char ->get ());
31
33
self ::assertEquals ('p ' , $ char ->__toString ());
@@ -83,4 +85,28 @@ public function testControlExists() : void
83
85
self ::assertTrue (InputCharacter::controlExists (InputCharacter::UP ));
84
86
self ::assertFalse (InputCharacter::controlExists ('w ' ));
85
87
}
88
+
89
+ public function testIsControlOnNotExplicitlyHandledControls () : void
90
+ {
91
+ $ char = new InputCharacter ("\016" ); //ctrl + p (I think)
92
+
93
+ self ::assertTrue ($ char ->isControl ());
94
+ self ::assertFalse ($ char ->isHandledControl ());
95
+
96
+ $ char = new InputCharacter ("\021" ); //ctrl + u (I think)
97
+
98
+ self ::assertTrue ($ char ->isControl ());
99
+ self ::assertFalse ($ char ->isHandledControl ());
100
+ }
101
+
102
+ public function testUnicodeCharacter () : void
103
+ {
104
+ $ char = new InputCharacter ('ß ' );
105
+
106
+ self ::assertFalse ($ char ->isControl ());
107
+ self ::assertFalse ($ char ->isHandledControl ());
108
+ self ::assertTrue ($ char ->isNotControl ());
109
+ self ::assertEquals ('ß ' , $ char ->get ());
110
+ self ::assertEquals ('ß ' , $ char ->__toString ());
111
+ }
86
112
}
0 commit comments