Compare commits

..

5 Commits

Author SHA1 Message Date
jaina heartles 10f3f33048 Download zig binary once
ci/woodpecker/push/woodpecker Pipeline failed Details
2022-12-18 05:01:55 -08:00
jaina heartles 6900c77a32 Add zig fmt step
ci/woodpecker/push/woodpecker Pipeline failed Details
2022-12-18 04:54:25 -08:00
jaina heartles 469df7bfcd Zig fmt 2022-12-18 04:51:23 -08:00
jaina heartles cac2b014c5 Update README.md
ci/woodpecker/push/woodpecker Pipeline failed Details
2022-12-18 04:46:55 -08:00
jaina heartles 7e6110fbfe Setup unit test CI
ci/woodpecker/push/woodpecker Pipeline failed Details
2022-12-18 04:44:56 -08:00
4 changed files with 21 additions and 6 deletions

View File

@ -6,9 +6,22 @@ clone:
lfs: false
pipeline:
zig-compiler:
image: alpine
- echo "Downloading dependencies..."
- apk add curl xz
- echo "Downloading zig binary..."
- curl https://ziglang.org/download/0.10.0/zig-linux-x86_64-0.10.0.tar.xz | xz -d | tar -x
format:
image: alpine
- echo "Checking formatting..."
- ./zig-linux-x86_64-0.10.0/zig fmt --check src/ tests/ build.zig
unit-tests:
image: alpine
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:template
- echo "Downloading dependencies..."
- apk add sqlite sqlite-dev libpq libpq-dev
- echo "Running unit tests..."
- ./zig-linux-x86_64-0.10.0/zig build unit

View File

@ -1,4 +1,6 @@
# Untitled Social Network server
# fediglam
[![status-badge](https://ci.heartles.xyz/api/badges/heartles/fediglam/status.svg)](https://ci.heartles.xyz/heartles/fediglam)
A (soon to be federated) social networking server
## Building
### Requirements

View File

@ -68,7 +68,7 @@ pub const Iter = struct {
/// + pub fn parse([]const u8) !F
///
/// Boolean Parameters:
/// The following query strings will all parse a `true` value for the
/// The following query strings will all parse a `true` value for the
/// parameter `foo: bool = false`:
/// - `?foo`
/// - `?foo=true`

View File

@ -1349,7 +1349,7 @@ test "template" {
try testCase("", .{}, "");
try testCase("abcd", .{}, "abcd");
try testCase("{.v}", .{ .v = @as(usize, 3) }, "4");
try testCase("{.val}", .{ .val = 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");