Skip to content

Commit ee65ef8

Browse files
committed
updated
1 parent f1cf6cb commit ee65ef8

3 files changed

Lines changed: 22 additions & 2 deletions

File tree

.ci/dagger/src/ci/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class Ci:
88
zig_binary = f"zig-x86_64-linux-{zig_version}"
99

1010
@function
11-
async def tests(self, src: dagger.Directory):
11+
async def tests(self, src: dagger.Directory) -> dagger.Container:
1212
return (
1313
dag.container()
1414
.from_("ubuntu:24.04")

RELEASE_NOTES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Upgraded dependancies and CI
1+
Upgraded dependancies and added some more tests.

src/root.zig

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
const std = @import("std");
22
const testing = std.testing;
33
const main = @import("main.zig");
4+
const helper = @import("helper.zig");
5+
const builtin = @import("builtin");
46

57
export fn add(a: i32, b: i32) i32 {
68
return a + b;
@@ -16,3 +18,21 @@ test "checking failed download" {
1618
const allocator = arena.allocator();
1719
try testing.expect(std.mem.eql(u8, try main.download(allocator, "https://durrrrr.io"), "unknown.txt"));
1820
}
21+
22+
test "checking replacer" {
23+
var arena = std.heap.ArenaAllocator.init(std.heap.page_allocator);
24+
defer arena.deinit();
25+
const allocator = arena.allocator();
26+
const check = try helper.replace(allocator, "This is a test", "This is a ", "");
27+
try testing.expect(std.mem.eql(u8, check, "test"));
28+
}
29+
30+
test "checking test_file_path" {
31+
if (builtin.os.tag == .windows) {
32+
const check = try helper.test_file_path("C:/Windows/System32/drivers/etc/hosts");
33+
try testing.expect(check);
34+
} else {
35+
const check = try helper.test_file_path("/etc/hosts");
36+
try testing.expect(check);
37+
}
38+
}

0 commit comments

Comments
 (0)