exercism / exercism/problem-specifications

Transpose test cases inconsistent.

Ouverte
#1,839 4 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Ruby
Étoiles
358
Forks
563
Merge moyen
18 h 41 min
PR mergées (30 j)
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))
}
```

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.