Skip to content

Commit 5b69d8a

Browse files
sync isbn-verifier (exercism#281)
1 parent 43fd9c7 commit 5b69d8a

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

exercises/practice/isbn-verifier/.meta/tests.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ description = "invalid character in isbn is not treated as zero"
3030
[28025280-2c39-4092-9719-f3234b89c627]
3131
description = "X is only valid as a check digit"
3232

33+
[8005b57f-f194-44ee-88d2-a77ac4142591]
34+
description = "only one check digit is allowed"
35+
36+
[fdb14c99-4cf8-43c5-b06d-eb1638eff343]
37+
description = "X is not substituted by the value 10"
38+
3339
[f6294e61-7e79-46b3-977b-f48789a4945b]
3440
description = "valid isbn without separating dashes"
3541

exercises/practice/isbn-verifier/run_test.v

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module main
22

3-
fn test_a_valid_isbn() {
3+
fn test_valid_isbn() {
44
assert is_valid('3-598-21508-8')
55
}
66

@@ -28,6 +28,14 @@ fn test_x_is_only_valid_as_a_check_digit() {
2828
assert !is_valid('3-598-2X507-9')
2929
}
3030

31+
fn test_only_one_check_digit_is_allowed() {
32+
assert !is_valid('3-598-21508-96')
33+
}
34+
35+
fn test_x_is_not_substituted_by_the_value_10() {
36+
assert !is_valid('3-598-2X507-5')
37+
}
38+
3139
fn test_valid_isbn_without_separating_dashes() {
3240
assert is_valid('3598215088')
3341
}

exercises/practice/line-up/.docs/instructions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ Yaʻqūb expects to use numbers from 1 up to 999.
55

66
Rules:
77

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

1313
Examples:

0 commit comments

Comments
 (0)