test: add keywordSyntax and isAllUpper tests

Adds unit tests for command keyword parsing and string casing. Also removes the unused `history_path` field from the `Terminal` struct.
This commit is contained in:
Adrià Arrufat committed 2026-05-11 17:52:49 +02:00
1 parent 82f6b4c002
commit 729de62012
3 files changed
+32 -2

No files matched your search

+12
View File
@@ -340,6 +340,18 @@ fn asUint(comptime string: anytype) std.meta.Int(
}
const testing = @import("testing.zig");
test "isAllUpper" {
try testing.expectEqual(false, isAllUpper(""));
try testing.expectEqual(true, isAllUpper("GOTO"));
try testing.expectEqual(true, isAllUpper("ACCEPT_COOKIES"));
try testing.expectEqual(true, isAllUpper("X1"));
try testing.expectEqual(true, isAllUpper("_"));
try testing.expectEqual(false, isAllUpper("Goto"));
try testing.expectEqual(false, isAllUpper("goto"));
try testing.expectEqual(false, isAllUpper("GO TO"));
}
test "String" {
const other_short = try String.init(undefined, "other_short", .{});
const other_long = try String.init(testing.allocator, "other_long" ** 100, .{});