@@ -12,24 +12,23 @@ main = hspecWith defaultConfig {configFastFail = True} specs
12
12
specs :: Spec
13
13
specs = describe " etl" $
14
14
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.
17
16
18
17
describe " transform" $ do
19
18
20
- it " transform one value " $
19
+ it " a single letter " $
21
20
transform (fromList [(1 , " A" )])
22
21
`shouldBe` fromList [(' a' , 1 )]
23
22
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 ) ]
27
26
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 )]
31
30
32
- it " full dataset " $
31
+ it " multiple scores with differing numbers of letters " $
33
32
transform (fromList fullInput)
34
33
`shouldBe` fromList fullOutput
35
34
0 commit comments