Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions exercises/practice/flower-field/.meta/tests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,6 @@ description = "cross"

[dd9d4ca8-9e68-4f78-a677-a2a70fd7a7b8]
description = "large garden"

[6e4ac13a-3e43-4728-a2e3-3551d4b1a996]
description = "multiple adjacent flowers"
14 changes: 14 additions & 0 deletions exercises/practice/flower-field/test_flower_field.zig
Original file line number Diff line number Diff line change
Expand Up @@ -232,3 +232,17 @@ test "large garden" {
.{ &expected, &garden },
);
}

test "multiple adjacent flowers" {
const garden = [_][]const u8{
" ** ", //
};
const expected = [_][]const u8{
"1**1", //
};
try std.testing.checkAllAllocationFailures(
std.testing.allocator,
annotateTest,
.{ &expected, &garden },
);
}
3 changes: 3 additions & 0 deletions exercises/practice/isbn-verifier/.meta/tests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ description = "invalid character in isbn is not treated as zero"
[28025280-2c39-4092-9719-f3234b89c627]
description = "X is only valid as a check digit"

[fdb14c99-4cf8-43c5-b06d-eb1638eff343]
description = "X is not substituted by the value 10"

[f6294e61-7e79-46b3-977b-f48789a4945b]
description = "valid isbn without separating dashes"

Expand Down
12 changes: 8 additions & 4 deletions exercises/practice/isbn-verifier/test_isbn_verifier.zig
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ test "valid ISBN with a check digit of 10" {
try testing.expect(isValidIsbn10("3-598-21507-X"));
}

test "check digit is a character other than x" {
test "check digit is a character other than X" {
try testing.expect(!isValidIsbn10("3-598-21507-A"));
}

Expand All @@ -27,15 +27,19 @@ test "invalid character in ISBN is not treated as zero" {
try testing.expect(!isValidIsbn10("3-598-P1581-X"));
}

test "x is only valid as a check digit" {
test "X is only valid as a check digit" {
try testing.expect(!isValidIsbn10("3-598-2X507-9"));
}

test "X is not substituted by the value 10" {
try testing.expect(!isValidIsbn10("3-598-2X507-5"));
}

test "valid ISBN without separating dashes" {
try testing.expect(isValidIsbn10("3598215088"));
}

test "ISBN without separating dashes and x as check digit" {
test "ISBN without separating dashes and X as check digit" {
try testing.expect(isValidIsbn10("359821507X"));
}

Expand All @@ -55,7 +59,7 @@ test "ISBN without check digit" {
try testing.expect(!isValidIsbn10("3-598-21507"));
}

test "check digit of x should not be used for 0" {
test "check digit of X should not be used for 0" {
try testing.expect(!isValidIsbn10("3-598-21515-X"));
}

Expand Down
6 changes: 3 additions & 3 deletions exercises/practice/line-up/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ Yaʻqūb expects to use numbers from 1 up to 999.

Rules:

- Numbers ending in 1 (except for 11) → `"st"`
- Numbers ending in 2 (except for 12) → `"nd"`
- Numbers ending in 3 (except for 13) → `"rd"`
- Numbers ending in 1 (unless ending in 11) → `"st"`
- Numbers ending in 2 (unless ending in 12) → `"nd"`
- Numbers ending in 3 (unless ending in 13) → `"rd"`
- All other numbers → `"th"`

Examples:
Expand Down