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
2026-05-11 15:51:53 +02:00
parent 82f6b4c002
commit 729de62012
3 changed files with 32 additions and 2 deletions

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, .{});