@@ -165,4 +165,71 @@ void isAscii() {
165165 assertFalse (StringUtil .isAscii ("测试" ));
166166 assertFalse (StringUtil .isAscii ("测试.com" ));
167167 }
168+
169+ @ Test void isAsciiLetter () {
170+ assertTrue (StringUtil .isAsciiLetter ('a' ));
171+ assertTrue (StringUtil .isAsciiLetter ('n' ));
172+ assertTrue (StringUtil .isAsciiLetter ('z' ));
173+ assertTrue (StringUtil .isAsciiLetter ('A' ));
174+ assertTrue (StringUtil .isAsciiLetter ('N' ));
175+ assertTrue (StringUtil .isAsciiLetter ('Z' ));
176+
177+ assertFalse (StringUtil .isAsciiLetter (' ' ));
178+ assertFalse (StringUtil .isAsciiLetter ('-' ));
179+ assertFalse (StringUtil .isAsciiLetter ('0' ));
180+ assertFalse (StringUtil .isAsciiLetter ('ß' ));
181+ assertFalse (StringUtil .isAsciiLetter ('Ě' ));
182+ }
183+
184+ @ Test void isDigit () {
185+ assertTrue (StringUtil .isDigit ('0' ));
186+ assertTrue (StringUtil .isDigit ('1' ));
187+ assertTrue (StringUtil .isDigit ('2' ));
188+ assertTrue (StringUtil .isDigit ('3' ));
189+ assertTrue (StringUtil .isDigit ('4' ));
190+ assertTrue (StringUtil .isDigit ('5' ));
191+ assertTrue (StringUtil .isDigit ('6' ));
192+ assertTrue (StringUtil .isDigit ('7' ));
193+ assertTrue (StringUtil .isDigit ('8' ));
194+ assertTrue (StringUtil .isDigit ('9' ));
195+
196+ assertFalse (StringUtil .isDigit ('a' ));
197+ assertFalse (StringUtil .isDigit ('A' ));
198+ assertFalse (StringUtil .isDigit ('ä' ));
199+ assertFalse (StringUtil .isDigit ('Ä' ));
200+ assertFalse (StringUtil .isDigit ('١' ));
201+ assertFalse (StringUtil .isDigit ('୳' ));
202+ }
203+
204+ @ Test void isHexDigit () {
205+ assertTrue (StringUtil .isHexDigit ('0' ));
206+ assertTrue (StringUtil .isHexDigit ('1' ));
207+ assertTrue (StringUtil .isHexDigit ('2' ));
208+ assertTrue (StringUtil .isHexDigit ('3' ));
209+ assertTrue (StringUtil .isHexDigit ('4' ));
210+ assertTrue (StringUtil .isHexDigit ('5' ));
211+ assertTrue (StringUtil .isHexDigit ('6' ));
212+ assertTrue (StringUtil .isHexDigit ('7' ));
213+ assertTrue (StringUtil .isHexDigit ('8' ));
214+ assertTrue (StringUtil .isHexDigit ('9' ));
215+ assertTrue (StringUtil .isHexDigit ('a' ));
216+ assertTrue (StringUtil .isHexDigit ('b' ));
217+ assertTrue (StringUtil .isHexDigit ('c' ));
218+ assertTrue (StringUtil .isHexDigit ('d' ));
219+ assertTrue (StringUtil .isHexDigit ('e' ));
220+ assertTrue (StringUtil .isHexDigit ('f' ));
221+ assertTrue (StringUtil .isHexDigit ('A' ));
222+ assertTrue (StringUtil .isHexDigit ('B' ));
223+ assertTrue (StringUtil .isHexDigit ('C' ));
224+ assertTrue (StringUtil .isHexDigit ('D' ));
225+ assertTrue (StringUtil .isHexDigit ('E' ));
226+ assertTrue (StringUtil .isHexDigit ('F' ));
227+
228+ assertFalse (StringUtil .isHexDigit ('g' ));
229+ assertFalse (StringUtil .isHexDigit ('G' ));
230+ assertFalse (StringUtil .isHexDigit ('ä' ));
231+ assertFalse (StringUtil .isHexDigit ('Ä' ));
232+ assertFalse (StringUtil .isHexDigit ('١' ));
233+ assertFalse (StringUtil .isHexDigit ('୳' ));
234+ }
168235}
0 commit comments