summaryrefslogtreecommitdiff
path: root/plugins/kotlin/jps/jps-plugin/tests/test/org/jetbrains/kotlin/jps/build/JoinToReadableStringTest.kt
blob: adc850d55e63f0080416971d051823eda42569ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.

package org.jetbrains.kotlin.jps.build

import junit.framework.TestCase

class JoinToReadableStringTest : TestCase() {
    fun test0() {
        assertEquals(
            "",
            listOf<String>().joinToReadableString()
        )
    }

    fun test1() {
        assertEquals(
            "a",
            listOf("a").joinToReadableString()
        )
    }

    fun test2() {
        assertEquals(
            "a and b",
            listOf("a", "b").joinToReadableString()
        )
    }

    fun test3() {
        assertEquals(
            "a, b and c",
            listOf("a", "b", "c").joinToReadableString()
        )
    }

    fun test4() {
        assertEquals(
            "a, b, c and d",
            listOf("a", "b", "c", "d").joinToReadableString()
        )
    }

    fun test5() {
        assertEquals(
            "a, b, c, d and e",
            listOf("a", "b", "c", "d", "e").joinToReadableString()
        )
    }

    fun test6() {
        assertEquals(
            "a, b, c, d, e and 1 more",
            listOf("a", "b", "c", "d", "e", "f").joinToReadableString()
        )
    }
}