Skip to content

Commit 0617c0f

Browse files
committed
tests: explicitly add isControl and isPrint test
1 parent 0f20fd9 commit 0617c0f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/std/ascii.zig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,12 @@ test "ASCII character classes" {
250250
try testing.expect(!isPrint(control_code.esc));
251251
}
252252

253+
test "isControl and isPrint compatibility" {
254+
var char: u8 = 0;
255+
while (char < 255) : (char += 1)
256+
try std.testing.expectEqual(isControl(char), !isPrint(char));
257+
}
258+
253259
/// Writes a lower case copy of `ascii_string` to `output`.
254260
/// Asserts `output.len >= ascii_string.len`.
255261
pub fn lowerString(output: []u8, ascii_string: []const u8) []u8 {

0 commit comments

Comments
 (0)