Skip to content

Commit a0e5ea6

Browse files
committed
book-store: Add test case requiring two moves to solve correctly
In the Rust track, @shybyte [implemented a very simple solver](http://exercism.io/submissions/9ede17337e074a108c69d767caa3ea79) for this problem which looked like it shouldn't work, but passed all existing test cases, and then requested my input. I came up with the following case, which correctly failed their implementation. This PR adds this case to the canonical data.
1 parent 6c2f275 commit a0e5ea6

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

exercises/book-store/canonical-data.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"exercise": "book-store",
3-
"version": "1.0.1",
3+
"version": "1.1.0",
44
"cases": [
55
{
66
"description": "Return the total basket price after applying the best discount.",
77
"comments": [
88
"Calculate lowest price for a shopping basket containing books only from ",
99
"a single series. There is no discount advantage for having more than ",
10-
"one copy of any single book in a grouping."
10+
"one copy of any single book in a grouping."
1111
],
1212
"cases": [
1313
{
@@ -100,6 +100,13 @@
100100
"basket": [1,1,2,2,3,3,4,4,5,5,1,2],
101101
"targetgrouping": [[1,2,3,4,5],[1,2,3,4,5],[1,2]],
102102
"expected": 75.20
103+
},
104+
{
105+
"property": "total",
106+
"description": "Two moves are required to find minimal price",
107+
"basket": [1,1,2,2,3,3,4,5,1,1,2,2,3,3,4,5],
108+
"targetgrouping": [[1,2,3,4],[1,2,3,5],[1,2,3,4],[1,2,3,5]],
109+
"expected": 102.4
103110
}
104111
]
105112
}

0 commit comments

Comments
 (0)