Skip to content

Commit 7e1cc72

Browse files
authored
Merge pull request #1021 from coriolinus/book-store-add-test-two-moves
book-store: Add test case requiring two moves to solve correctly
2 parents 2d97a9b + a636903 commit 7e1cc72

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": "Four groups of four are cheaper than two groups each of five and three",
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)