Sha256: bd04b60b24c33b14f6834ea929a6cab2e518952c46655b31ea8167578282bc2e

Contents?: true

Size: 1.6 KB

Versions: 129

Compression:

Stored size: 1.6 KB

Contents

import org.junit.Assert.assertArrayEquals
import org.junit.Ignore
import org.junit.Test

class SpiralMatrixTest {

    @Test
    fun testEmptySpiral() {
        val expected = emptyArray<IntArray>()

        assertArrayEquals(expected, SpiralMatrix.ofSize(0))
    }

    @Ignore
    @Test
    fun testTrivialSpiral() {
        val expected = arrayOf(
            intArrayOf(1)
        )

        assertArrayEquals(expected, SpiralMatrix.ofSize(1))
    }

    @Ignore
    @Test
    fun testSpiralOfSize2() {
        val expected = arrayOf(
            intArrayOf(1, 2),
            intArrayOf(4, 3)
        )

        assertArrayEquals(expected, SpiralMatrix.ofSize(2))
    }

    @Ignore
    @Test
    fun testSpiralOfSize3() {
        val expected = arrayOf(
            intArrayOf(1, 2, 3),
            intArrayOf(8, 9, 4),
            intArrayOf(7, 6, 5)
        )

        assertArrayEquals(expected, SpiralMatrix.ofSize(3))
    }

    @Ignore
    @Test
    fun testSpiralOfSize4() {
        val expected = arrayOf(
            intArrayOf( 1,  2,  3,  4),
            intArrayOf(12, 13, 14,  5),
            intArrayOf(11, 16, 15,  6),
            intArrayOf(10,  9,  8,  7)
        )

        assertArrayEquals(expected, SpiralMatrix.ofSize(4))
    }

    @Ignore
    @Test
    fun testSpiralOfSize5() {
        val expected = arrayOf(
            intArrayOf( 1,  2,  3,  4,  5),
            intArrayOf(16, 17, 18, 19,  6),
            intArrayOf(15, 24, 25, 20,  7),
            intArrayOf(14, 23, 22, 21,  8),
            intArrayOf(13, 12, 11, 10,  9)
        )

        assertArrayEquals(expected, SpiralMatrix.ofSize(5))
    }

}

Version data entries

129 entries across 129 versions & 1 rubygems

Version Path
trackler-2.2.1.98 tracks/kotlin/exercises/spiral-matrix/src/test/kotlin/SpiralMatrixTest.kt
trackler-2.2.1.97 tracks/kotlin/exercises/spiral-matrix/src/test/kotlin/SpiralMatrixTest.kt
trackler-2.2.1.96 tracks/kotlin/exercises/spiral-matrix/src/test/kotlin/SpiralMatrixTest.kt
trackler-2.2.1.95 tracks/kotlin/exercises/spiral-matrix/src/test/kotlin/SpiralMatrixTest.kt
trackler-2.2.1.94 tracks/kotlin/exercises/spiral-matrix/src/test/kotlin/SpiralMatrixTest.kt
trackler-2.2.1.93 tracks/kotlin/exercises/spiral-matrix/src/test/kotlin/SpiralMatrixTest.kt
trackler-2.2.1.92 tracks/kotlin/exercises/spiral-matrix/src/test/kotlin/SpiralMatrixTest.kt
trackler-2.2.1.91 tracks/kotlin/exercises/spiral-matrix/src/test/kotlin/SpiralMatrixTest.kt
trackler-2.2.1.90 tracks/kotlin/exercises/spiral-matrix/src/test/kotlin/SpiralMatrixTest.kt
trackler-2.2.1.89 tracks/kotlin/exercises/spiral-matrix/src/test/kotlin/SpiralMatrixTest.kt
trackler-2.2.1.88 tracks/kotlin/exercises/spiral-matrix/src/test/kotlin/SpiralMatrixTest.kt
trackler-2.2.1.87 tracks/kotlin/exercises/spiral-matrix/src/test/kotlin/SpiralMatrixTest.kt
trackler-2.2.1.86 tracks/kotlin/exercises/spiral-matrix/src/test/kotlin/SpiralMatrixTest.kt
trackler-2.2.1.85 tracks/kotlin/exercises/spiral-matrix/src/test/kotlin/SpiralMatrixTest.kt
trackler-2.2.1.84 tracks/kotlin/exercises/spiral-matrix/src/test/kotlin/SpiralMatrixTest.kt
trackler-2.2.1.83 tracks/kotlin/exercises/spiral-matrix/src/test/kotlin/SpiralMatrixTest.kt
trackler-2.2.1.82 tracks/kotlin/exercises/spiral-matrix/src/test/kotlin/SpiralMatrixTest.kt
trackler-2.2.1.81 tracks/kotlin/exercises/spiral-matrix/src/test/kotlin/SpiralMatrixTest.kt
trackler-2.2.1.80 tracks/kotlin/exercises/spiral-matrix/src/test/kotlin/SpiralMatrixTest.kt
trackler-2.2.1.79 tracks/kotlin/exercises/spiral-matrix/src/test/kotlin/SpiralMatrixTest.kt