From a251669fa1ef9dc148d3477d6f5721db01dd5f60 Mon Sep 17 00:00:00 2001 From: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Date: Sun, 20 Nov 2022 17:58:13 -0800 Subject: Make it yellow --- src/cli/test_command.zig | 2 +- src/string_immutable.zig | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/cli/test_command.zig b/src/cli/test_command.zig index 916ae63d9..11b764893 100644 --- a/src/cli/test_command.zig +++ b/src/cli/test_command.zig @@ -374,7 +374,7 @@ pub const TestCommand = struct { if (scanner.filter_names.len == 0 and test_files.len == 0) { Output.prettyErrorln( - \\0 tests found! Tests need ".test", "_test_", ".spec" or "_spec_" in the filename (ex: "MyApp.test.ts") + \\No tests found! Tests need ".test", "_test_", ".spec" or "_spec_" in the filename (ex: "MyApp.test.ts") \\ , .{}, diff --git a/src/string_immutable.zig b/src/string_immutable.zig index 9a0165020..38701698c 100644 --- a/src/string_immutable.zig +++ b/src/string_immutable.zig @@ -652,6 +652,10 @@ pub fn hasPrefixComptime(self: string, comptime alt: anytype) bool { return self.len >= alt.len and eqlComptimeCheckLenWithType(u8, self[0..alt.len], alt, false); } +/// Check if two strings are equal with one of the strings being a comptime-known value +/// +/// strings.eqlComptime(input, "hello world"); +/// strings.eqlComptime(input, "hai"); pub inline fn eqlComptimeCheckLenWithType(comptime Type: type, a: []const Type, comptime b: anytype, comptime check_len: bool) bool { @setEvalBranchQuota(9999); if (comptime check_len) { -- cgit v1.2.3