forked from igorwojda/kotlin-coding-challenges
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathchallenge.kt
executable file
·65 lines (52 loc) · 1.41 KB
/
challenge.kt
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
57
58
59
60
61
62
63
64
65
package com.igorwojda.string.surroundedletter
import org.amshove.kluent.shouldBeEqualTo
import org.junit.jupiter.api.Test
private fun surroundedLetter(str: String): Boolean {
TODO("not implemented")
}
private class Test {
@Test
fun `"a" return "false"`() {
surroundedLetter("a") shouldBeEqualTo false
}
@Test
fun `"+a+" return "true"`() {
surroundedLetter("+a+") shouldBeEqualTo true
}
@Test
fun `"a+" return "false"`() {
surroundedLetter("a+") shouldBeEqualTo false
}
@Test
fun `"+a" return "false"`() {
surroundedLetter("+a") shouldBeEqualTo false
}
@Test
fun `"+a+b+" return "true"`() {
surroundedLetter("+a+b+") shouldBeEqualTo true
}
@Test
fun `"+a++b+" return "true"`() {
surroundedLetter("+a++b+") shouldBeEqualTo true
}
@Test
fun `"+ab+" return "false"`() {
surroundedLetter("+ab+") shouldBeEqualTo false
}
@Test
fun `"a+b+" return "false"`() {
surroundedLetter("a+b+") shouldBeEqualTo false
}
@Test
fun `"+a+b" return "false"`() {
surroundedLetter("+a+b") shouldBeEqualTo false
}
@Test
fun `"+a+b+++c++d+e++" return "true"`() {
surroundedLetter("+a+b+++c++d+e++") shouldBeEqualTo true
}
@Test
fun `"+++a+d++de++e++" return "false"`() {
surroundedLetter("+a+d++de++e+") shouldBeEqualTo false
}
}