Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add test for single character string for RunLengthEncoding exercise #797

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -24,6 +24,10 @@ class RunLengthEncodingTest extends AnyFunSuite with Matchers {
RunLengthEncoding.encode("WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWB") should be ("12WB12W3B24WB")
}

test("encode - string with one character") {
RunLengthEncoding.encode("X") should be ("X")
}

test("encode - multiple whitespace mixed in string") {
pending
RunLengthEncoding.encode(" hsqq qww ") should be ("2 hs2q q2w2 ")
@@ -49,6 +53,10 @@ class RunLengthEncodingTest extends AnyFunSuite with Matchers {
RunLengthEncoding.decode("2A3B4C") should be ("AABBBCCCC")
}

test("decode - string with one character") {
RunLengthEncoding.decode("X") should be ("X")
}

test("decode - single characters with repeated characters") {
pending
RunLengthEncoding.decode("12WB12W3B24WB") should be ("WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWB")
@@ -68,4 +76,4 @@ class RunLengthEncodingTest extends AnyFunSuite with Matchers {
pending
RunLengthEncoding.decode(RunLengthEncoding.encode("zzz ZZ zZ")) should be ("zzz ZZ zZ")
}
}
}