exercism / exercism/problem-specifications

Transpose test cases inconsistent.

Open
#1,839 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Ruby
Stars
358
Forks
563
Avg merge
18h 41m
Merged PRs (30d)
2

Description

As the name exercise Transpose, the exercise is similar to Matrix exercise, but use character in the matrix cell.
## Discrepancy between test cases, in Kotlin but the issues are for all tracks
- Given 2 rows with uneven length
- The solutions should pad the length to longest length with *space*, and transpose it
- Expected, the transposed chars is a pair of transposed , exactly like `second line longer than first line` where the last pair is " ." , space followed by dot.
- Bugs on first line longer than second line case, where last pair only expected single char.
- Bugs on mixed line length test case as well. The expected transposed chars, should have all 4 characters.
```
@Test
fun `first line longer than second line`() {
val lines = listOf("The fourth line.", "The fifth line.")
val expected = listOf("TT", "hh", "ee", " ", "ff", "oi", "uf", "rt", "th", "h ", " l", "li", "in", "ne", "e.", ".")
assertEquals(expected, Transpose.transpose(lines))
}

@Test
fun `second line longer than first line`() {
val lines = listOf("The first line.", "The second line.")
val expected = listOf("TT", "hh", "ee", " ", "fs", "ie", "rc", "so", "tn", " d", "l ", "il", "ni", "en", ".e", " .")
assertEquals(expected, Transpose.transpose(lines))
}

@Test
fun `mixed line length`() {
val lines = listOf("The longest line.", "A long line.", "A longer line.", "A line.")
val expected = listOf("TAAA", "h ", "elll", " ooi", "lnnn", "ogge", "n e.", "glr", "ei ", "snl", "tei", " .n", "l e", "i .", "n", "e", ".")
assertEquals(expected, Transpose.transpose(lines))
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.