mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-06-11 09:35:59 -04:00
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:
@@ -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, .{});
|
||||
|
||||
Reference in New Issue
Block a user