Sha256: 1c909eccf5f60284a433857872922993472af55f4c8f1a29321e67b95e5345aa

Contents?: true

Size: 1.63 KB

Versions: 59

Compression:

Stored size: 1.63 KB

Contents

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

/*
 * version: 1.0.0
 */
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

59 entries across 59 versions & 1 rubygems

Version Path
trackler-2.2.1.29 tracks/kotlin/exercises/spiral-matrix/src/test/kotlin/SpiralMatrixTest.kt
trackler-2.2.1.28 tracks/kotlin/exercises/spiral-matrix/src/test/kotlin/SpiralMatrixTest.kt
trackler-2.2.1.27 tracks/kotlin/exercises/spiral-matrix/src/test/kotlin/SpiralMatrixTest.kt
trackler-2.2.1.26 tracks/kotlin/exercises/spiral-matrix/src/test/kotlin/SpiralMatrixTest.kt
trackler-2.2.1.25 tracks/kotlin/exercises/spiral-matrix/src/test/kotlin/SpiralMatrixTest.kt
trackler-2.2.1.24 tracks/kotlin/exercises/spiral-matrix/src/test/kotlin/SpiralMatrixTest.kt
trackler-2.2.1.23 tracks/kotlin/exercises/spiral-matrix/src/test/kotlin/SpiralMatrixTest.kt
trackler-2.2.1.22 tracks/kotlin/exercises/spiral-matrix/src/test/kotlin/SpiralMatrixTest.kt
trackler-2.2.1.21 tracks/kotlin/exercises/spiral-matrix/src/test/kotlin/SpiralMatrixTest.kt
trackler-2.2.1.20 tracks/kotlin/exercises/spiral-matrix/src/test/kotlin/SpiralMatrixTest.kt
trackler-2.2.1.19 tracks/kotlin/exercises/spiral-matrix/src/test/kotlin/SpiralMatrixTest.kt
trackler-2.2.1.18 tracks/kotlin/exercises/spiral-matrix/src/test/kotlin/SpiralMatrixTest.kt
trackler-2.2.1.17 tracks/kotlin/exercises/spiral-matrix/src/test/kotlin/SpiralMatrixTest.kt
trackler-2.2.1.16 tracks/kotlin/exercises/spiral-matrix/src/test/kotlin/SpiralMatrixTest.kt
trackler-2.2.1.15 tracks/kotlin/exercises/spiral-matrix/src/test/kotlin/SpiralMatrixTest.kt
trackler-2.2.1.14 tracks/kotlin/exercises/spiral-matrix/src/test/kotlin/SpiralMatrixTest.kt
trackler-2.2.1.13 tracks/kotlin/exercises/spiral-matrix/src/test/kotlin/SpiralMatrixTest.kt
trackler-2.2.1.12 tracks/kotlin/exercises/spiral-matrix/src/test/kotlin/SpiralMatrixTest.kt
trackler-2.2.1.11 tracks/kotlin/exercises/spiral-matrix/src/test/kotlin/SpiralMatrixTest.kt
trackler-2.2.1.10 tracks/kotlin/exercises/spiral-matrix/src/test/kotlin/SpiralMatrixTest.kt