Skip to content

Commit

Permalink
run-length-encoding 1.0.0.2: add whitespace and lowercase
Browse files Browse the repository at this point in the history
  • Loading branch information
petertseng committed May 8, 2017
1 parent 152be15 commit ff8aba4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion exercises/run-length-encoding/package.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: run-length-encoding
version: 0.9.0.1 # 2016-12-26
version: 1.0.0.2

dependencies:
- base
Expand Down
16 changes: 16 additions & 0 deletions exercises/run-length-encoding/test/Tests.hs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ encodeCases =
, input = "WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWB"
, expected = "12WB12W3B24WB"
}
, Case { description = "encode whitespace"
, input = " hsqq qww "
, expected = "2 hs2q q2w2 "
}
, Case { description = "encode lowercase"
, input = "aabbbcccc"
, expected = "2a3b4c"
}
]

decodeCases :: [Case]
Expand All @@ -60,6 +68,14 @@ decodeCases =
, input = "12WB12W3B24WB"
, expected = "WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWB"
}
, Case { description = "decode whitespace"
, input = "2 hs2q q2w2 "
, expected = " hsqq qww "
}
, Case { description = "decode lowercase"
, input = "2a3b4c"
, expected = "aabbbcccc"
}
]

bothCases :: [Case]
Expand Down

0 comments on commit ff8aba4

Please sign in to comment.