Skip to content

Commit 68d44cf

Browse files
authored
etl: use cases from x-common (#483)
exercism/problem-specifications#507
1 parent 60bc990 commit 68d44cf

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

exercises/etl/test/Tests.hs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,23 @@ main = hspecWith defaultConfig {configFastFail = True} specs
1212
specs :: Spec
1313
specs = describe "etl" $
1414

15-
-- As of 2016-07-27, there was no reference file
16-
-- for the test cases in `exercism/x-common`.
15+
-- Test cases adapted from `exercism/x-common/etl` on 2017-01-31.
1716

1817
describe "transform" $ do
1918

20-
it "transform one value" $
19+
it "a single letter" $
2120
transform (fromList [(1, "A")])
2221
`shouldBe` fromList [('a', 1)]
2322

24-
it "transform multiple keys from one value" $
25-
transform (fromList [(1, "AE")])
26-
`shouldBe` fromList [('a', 1), ('e', 1)]
23+
it "single score with multiple letters" $
24+
transform (fromList [(1, "AEIOU")])
25+
`shouldBe` fromList [('a', 1), ('e', 1), ('i', 1), ('o', 1), ('u', 1)]
2726

28-
it "transform multiple keys from multiple values" $
29-
transform (fromList [(1, "A"), (4, "B")])
30-
`shouldBe` fromList [('a', 1), ('b', 4)]
27+
it "multiple scores with multiple letters" $
28+
transform (fromList [(1, "AE"), (2, "DG")])
29+
`shouldBe` fromList [('a', 1), ('e', 1), ('d', 2), ('g', 2)]
3130

32-
it "full dataset" $
31+
it "multiple scores with differing numbers of letters" $
3332
transform (fromList fullInput)
3433
`shouldBe` fromList fullOutput
3534

0 commit comments

Comments
 (0)