From 9fd8effba678fc1b290bf97c61936cb93980df3d Mon Sep 17 00:00:00 2001 From: jaina heartles Date: Sun, 18 Dec 2022 02:23:16 -0800 Subject: [PATCH 1/5] Add .woodpecker.yml --- .woodpecker.yml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .woodpecker.yml diff --git a/.woodpecker.yml b/.woodpecker.yml new file mode 100644 index 0000000..e66d171 --- /dev/null +++ b/.woodpecker.yml @@ -0,0 +1,6 @@ +pipeline: + unit-tests: + image: alpine + commands: + - apk add sqlite + - zig build unit From 19585a295dc0ef63708c4d0865e3e42cb4891953 Mon Sep 17 00:00:00 2001 From: jaina heartles Date: Sun, 18 Dec 2022 02:57:26 -0800 Subject: [PATCH 2/5] skip lfs --- .woodpecker.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.woodpecker.yml b/.woodpecker.yml index e66d171..be61aa8 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -1,3 +1,10 @@ +clone: + git: + image: woodpeckerci/plugin-git + settings: + depth: 1 + lfs: false + pipeline: unit-tests: image: alpine From 4f96e752a8bf3cf428530e01af45c0c29ce6ecd7 Mon Sep 17 00:00:00 2001 From: jaina heartles Date: Sun, 18 Dec 2022 03:59:31 -0800 Subject: [PATCH 3/5] dependencies --- .woodpecker.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index be61aa8..27dd3bc 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -9,5 +9,6 @@ pipeline: unit-tests: image: alpine commands: - - apk add sqlite - - zig build unit + - apk add sqlite sqlite-dev libpq libpq-dev curl xz + - curl https://ziglang.org/download/0.10.0/zig-linux-x86_64-0.10.0.tar.xz | xz -d | tar -x + - ./zig-linux-x86_64-0.10.0/zig build unit From 08eec536a00fb66158233faf26db22835c0665e1 Mon Sep 17 00:00:00 2001 From: jaina heartles Date: Sun, 18 Dec 2022 04:11:34 -0800 Subject: [PATCH 4/5] Testing a passing test --- .woodpecker.yml | 2 +- src/template/lib.zig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 27dd3bc..c6c1ab2 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -11,4 +11,4 @@ pipeline: commands: - apk add sqlite sqlite-dev libpq libpq-dev curl xz - curl https://ziglang.org/download/0.10.0/zig-linux-x86_64-0.10.0.tar.xz | xz -d | tar -x - - ./zig-linux-x86_64-0.10.0/zig build unit + - ./zig-linux-x86_64-0.10.0/zig build unit:template diff --git a/src/template/lib.zig b/src/template/lib.zig index 4698cab..78b8cb8 100644 --- a/src/template/lib.zig +++ b/src/template/lib.zig @@ -1349,7 +1349,7 @@ test "template" { try testCase("", .{}, ""); try testCase("abcd", .{}, "abcd"); - try testCase("{.val}", .{ .val = 3 }, "3"); + try testCase("{.v}", .{ .v = @as(usize, 3) }, "3"); try testCase("{#if .val}1{/if}", .{ .val = true }, "1"); try testCase("{#for .vals |$v|=} {$v} {=/for}", .{ .vals = [_]u8{ 1, 2, 3 } }, "123"); try testCase("{#for .vals |$val|}{$val}{/for}", .{ .vals = [_]u8{ 1, 2, 3 } }, "123"); From 64bdf1c48ac4c27e6f998c13769bf899de66fb05 Mon Sep 17 00:00:00 2001 From: jaina heartles Date: Sun, 18 Dec 2022 04:12:26 -0800 Subject: [PATCH 5/5] testing a failing test --- src/template/lib.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/template/lib.zig b/src/template/lib.zig index 78b8cb8..4f2691e 100644 --- a/src/template/lib.zig +++ b/src/template/lib.zig @@ -1349,7 +1349,7 @@ test "template" { try testCase("", .{}, ""); try testCase("abcd", .{}, "abcd"); - try testCase("{.v}", .{ .v = @as(usize, 3) }, "3"); + try testCase("{.v}", .{ .v = @as(usize, 3) }, "4"); try testCase("{#if .val}1{/if}", .{ .val = true }, "1"); try testCase("{#for .vals |$v|=} {$v} {=/for}", .{ .vals = [_]u8{ 1, 2, 3 } }, "123"); try testCase("{#for .vals |$val|}{$val}{/for}", .{ .vals = [_]u8{ 1, 2, 3 } }, "123");