Skip to content

Commit 398695a

Browse files
authored
isbn-verifier: update tests (#2108)
1 parent 4d46bf5 commit 398695a

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
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/tests/isbn_verifier.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,18 @@ fn x_is_only_valid_as_a_check_digit() {
4141
assert!(!is_valid_isbn("3-598-2X507-9"));
4242
}
4343

44+
#[test]
45+
#[ignore]
46+
fn only_one_check_digit_is_allowed() {
47+
assert!(!is_valid_isbn("3-598-21508-96"));
48+
}
49+
50+
#[test]
51+
#[ignore]
52+
fn x_is_not_substituted_by_the_value_10() {
53+
assert!(!is_valid_isbn("3-598-2X507-5"));
54+
}
55+
4456
#[test]
4557
#[ignore]
4658
fn valid_isbn_without_separating_dashes() {

0 commit comments

Comments
 (0)