Open-source multiplayer game server compatible with the RuneScape client
https://www.openrs2.org/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
606 B
24 lines
606 B
4 years ago
|
package org.openrs2.util
|
||
5 years ago
|
|
||
|
import kotlin.test.Test
|
||
|
import kotlin.test.assertEquals
|
||
|
import kotlin.test.assertFailsWith
|
||
|
|
||
|
object StringUtilsTest {
|
||
|
@Test
|
||
|
fun testIndefiniteArticle() {
|
||
5 years ago
|
assertEquals("a", "book".indefiniteArticle())
|
||
|
assertEquals("an", "aeroplane".indefiniteArticle())
|
||
5 years ago
|
assertFailsWith(IllegalArgumentException::class) {
|
||
5 years ago
|
"".indefiniteArticle()
|
||
5 years ago
|
}
|
||
|
}
|
||
4 years ago
|
|
||
|
@Test
|
||
|
fun testKrHashCode() {
|
||
|
assertEquals(0, "".krHashCode())
|
||
|
assertEquals(99162322, "hello".krHashCode())
|
||
|
assertEquals(92340183, "h€llo".krHashCode())
|
||
|
}
|
||
5 years ago
|
}
|