forked from igorwojda/kotlin-coding-challenges
-
Notifications
You must be signed in to change notification settings - Fork 0
/
challenge.kt
60 lines (48 loc) · 1.42 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
package com.igorwojda.string.ispalindrome.tolerant
import org.amshove.kluent.shouldBeEqualTo
import org.junit.jupiter.api.Test
private fun isTolerantPalindrome(str: String, characterRemoved: Boolean = false): Boolean {
TODO("not implemented")
}
private class Test {
@Test
fun `"aba" is a palindrome`() {
isTolerantPalindrome("aba") shouldBeEqualTo true
}
@Test
fun `"ab!a" is a palindrome`() {
isTolerantPalindrome("ab!a") shouldBeEqualTo true
}
@Test
fun `"a!ba" is a palindrome`() {
isTolerantPalindrome("a!ba") shouldBeEqualTo true
}
@Test
fun `" aba" is a palindrome`() {
isTolerantPalindrome(" aba") shouldBeEqualTo true
}
@Test
fun `"aa#!aa " is not a palindrome`() {
isTolerantPalindrome("aa#!aa ") shouldBeEqualTo false
}
@Test
fun `"greetings" is not a palindrome`() {
isTolerantPalindrome("greetings") shouldBeEqualTo false
}
@Test
fun `"1000000001" a palindrome`() {
isTolerantPalindrome("1000000001") shouldBeEqualTo true
}
@Test
fun `"10A00000001" is a palindrome`() {
isTolerantPalindrome("10A00000001") shouldBeEqualTo true
}
@Test
fun `"Fish hsif" is not a palindrome`() {
isTolerantPalindrome("Fish hsif") shouldBeEqualTo false
}
@Test
fun `"pennep" a palindrome`() {
isTolerantPalindrome("pennep") shouldBeEqualTo true
}
}