| ... | ... | @@ -200,9 +200,11 @@ test "ASCII character classes" { |
| 200 | 200 | |
| 201 | 201 | try testing.expect(!isControl('a')); |
| 202 | 202 | try testing.expect(!isControl('z')); |
| 203 | try testing.expect(!isControl(' ')); |
| 203 | 204 | try testing.expect(isControl(control_code.nul)); |
| 204 | 205 | try testing.expect(isControl(control_code.ff)); |
| 205 | 206 | try testing.expect(isControl(control_code.us)); |
| 207 | try testing.expect(isControl(control_code.del)); |
| 206 | 208 | try testing.expect(!isControl(0x80)); |
| 207 | 209 | try testing.expect(!isControl(0xff)); |
| 208 | 210 | |
| ... | ... | @@ -210,36 +212,53 @@ test "ASCII character classes" { |
| 210 | 212 | try testing.expect(':' == toUpper(':')); |
| 211 | 213 | try testing.expect('\xab' == toUpper('\xab')); |
| 212 | 214 | try testing.expect(!isUpper('z')); |
| 215 | try testing.expect(!isUpper(0x80)); |
| 216 | try testing.expect(!isUpper(0xff)); |
| 213 | 217 | |
| 214 | 218 | try testing.expect('c' == toLower('C')); |
| 215 | 219 | try testing.expect(':' == toLower(':')); |
| 216 | 220 | try testing.expect('\xab' == toLower('\xab')); |
| 217 | 221 | try testing.expect(!isLower('Z')); |
| 222 | try testing.expect(!isLower(0x80)); |
| 223 | try testing.expect(!isLower(0xff)); |
| 218 | 224 | |
| 219 | 225 | try testing.expect(isAlphanumeric('Z')); |
| 220 | 226 | try testing.expect(isAlphanumeric('z')); |
| 221 | 227 | try testing.expect(isAlphanumeric('5')); |
| 222 | | try testing.expect(isAlphanumeric('5')); |
| 228 | try testing.expect(isAlphanumeric('a')); |
| 223 | 229 | try testing.expect(!isAlphanumeric('!')); |
| 230 | try testing.expect(!isAlphanumeric(0x80)); |
| 231 | try testing.expect(!isAlphanumeric(0xff)); |
| 224 | 232 | |
| 225 | 233 | try testing.expect(!isAlphabetic('5')); |
| 226 | 234 | try testing.expect(isAlphabetic('c')); |
| 227 | | try testing.expect(!isAlphabetic('5')); |
| 235 | try testing.expect(!isAlphabetic('@')); |
| 236 | try testing.expect(isAlphabetic('Z')); |
| 237 | try testing.expect(!isAlphabetic(0x80)); |
| 238 | try testing.expect(!isAlphabetic(0xff)); |
| 228 | 239 | |
| 229 | 240 | try testing.expect(isWhitespace(' ')); |
| 230 | 241 | try testing.expect(isWhitespace('\t')); |
| 231 | 242 | try testing.expect(isWhitespace('\r')); |
| 232 | 243 | try testing.expect(isWhitespace('\n')); |
| 244 | try testing.expect(isWhitespace(control_code.ff)); |
| 233 | 245 | try testing.expect(!isWhitespace('.')); |
| 246 | try testing.expect(!isWhitespace(control_code.us)); |
| 247 | try testing.expect(!isWhitespace(0x80)); |
| 248 | try testing.expect(!isWhitespace(0xff)); |
| 234 | 249 | |
| 235 | 250 | try testing.expect(!isHex('g')); |
| 236 | 251 | try testing.expect(isHex('b')); |
| 237 | 252 | try testing.expect(isHex('F')); |
| 238 | 253 | try testing.expect(isHex('9')); |
| 254 | try testing.expect(!isHex(0x80)); |
| 255 | try testing.expect(!isHex(0xff)); |
| 239 | 256 | |
| 240 | 257 | try testing.expect(!isDigit('~')); |
| 241 | 258 | try testing.expect(isDigit('0')); |
| 242 | 259 | try testing.expect(isDigit('9')); |
| 260 | try testing.expect(!isDigit(0x80)); |
| 261 | try testing.expect(!isDigit(0xff)); |
| 243 | 262 | |
| 244 | 263 | try testing.expect(isPrint(' ')); |
| 245 | 264 | try testing.expect(isPrint('@')); |