summaryrefslogtreecommitdiff
path: root/common/src/commonTest
diff options
context:
space:
mode:
Diffstat (limited to 'common/src/commonTest')
-rw-r--r--common/src/commonTest/kotlin/net/taler/lib/common/AmountTest.kt (renamed from common/src/commonTest/kotlin/net/taler/common/AmountTest.kt)15
-rw-r--r--common/src/commonTest/kotlin/net/taler/lib/common/TalerUriTest.kt (renamed from common/src/commonTest/kotlin/net/taler/common/TalerUriTest.kt)6
-rw-r--r--common/src/commonTest/kotlin/net/taler/lib/common/TestUtils.kt (renamed from common/src/commonTest/kotlin/net/taler/common/TestUtils.kt)16
-rw-r--r--common/src/commonTest/kotlin/net/taler/lib/common/TimeTest.kt (renamed from common/src/commonTest/kotlin/net/taler/common/TimeTest.kt)4
-rw-r--r--common/src/commonTest/kotlin/net/taler/lib/common/VersionTest.kt (renamed from common/src/commonTest/kotlin/net/taler/common/VersionTest.kt)2
5 files changed, 22 insertions, 21 deletions
diff --git a/common/src/commonTest/kotlin/net/taler/common/AmountTest.kt b/common/src/commonTest/kotlin/net/taler/lib/common/AmountTest.kt
index e184307..90b0569 100644
--- a/common/src/commonTest/kotlin/net/taler/common/AmountTest.kt
+++ b/common/src/commonTest/kotlin/net/taler/lib/common/AmountTest.kt
@@ -14,14 +14,13 @@
* GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
*/
-package net.taler.common
+package net.taler.lib.common
import kotlin.random.Random
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertFalse
import kotlin.test.assertTrue
-import kotlin.test.fail
class AmountTest {
@@ -219,16 +218,4 @@ class AmountTest {
}
}
- private inline fun <reified T : Throwable> assertThrows(
- msg: String? = null,
- function: () -> Any
- ) {
- try {
- function.invoke()
- fail(msg)
- } catch (e: Exception) {
- assertTrue(e is T)
- }
- }
-
}
diff --git a/common/src/commonTest/kotlin/net/taler/common/TalerUriTest.kt b/common/src/commonTest/kotlin/net/taler/lib/common/TalerUriTest.kt
index f996fa9..ca3430d 100644
--- a/common/src/commonTest/kotlin/net/taler/common/TalerUriTest.kt
+++ b/common/src/commonTest/kotlin/net/taler/lib/common/TalerUriTest.kt
@@ -14,10 +14,10 @@
* GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
*/
-package net.taler.common
+package net.taler.lib.common
-import net.taler.common.TalerUri.WithdrawUriResult
-import net.taler.common.TalerUri.parseWithdrawUri
+import net.taler.lib.common.TalerUri.WithdrawUriResult
+import net.taler.lib.common.TalerUri.parseWithdrawUri
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertNull
diff --git a/common/src/commonTest/kotlin/net/taler/common/TestUtils.kt b/common/src/commonTest/kotlin/net/taler/lib/common/TestUtils.kt
index e3a6c17..837de27 100644
--- a/common/src/commonTest/kotlin/net/taler/common/TestUtils.kt
+++ b/common/src/commonTest/kotlin/net/taler/lib/common/TestUtils.kt
@@ -14,9 +14,11 @@
* GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
*/
-package net.taler.common
+package net.taler.lib.common
import kotlin.random.Random
+import kotlin.test.assertTrue
+import kotlin.test.fail
private val charPool: List<Char> = ('a'..'z') + ('A'..'Z') + ('0'..'9')
fun getRandomString(minLength: Int = 1, maxLength: Int = Random.nextInt(0, 1337)) =
@@ -24,3 +26,15 @@ fun getRandomString(minLength: Int = 1, maxLength: Int = Random.nextInt(0, 1337)
.map { Random.nextInt(0, charPool.size) }
.map(charPool::get)
.joinToString("")
+
+inline fun <reified T : Throwable> assertThrows(
+ msg: String? = null,
+ function: () -> Any
+) {
+ try {
+ function.invoke()
+ fail(msg)
+ } catch (e: Exception) {
+ assertTrue(e is T)
+ }
+}
diff --git a/common/src/commonTest/kotlin/net/taler/common/TimeTest.kt b/common/src/commonTest/kotlin/net/taler/lib/common/TimeTest.kt
index 3ee0a99..647e439 100644
--- a/common/src/commonTest/kotlin/net/taler/common/TimeTest.kt
+++ b/common/src/commonTest/kotlin/net/taler/lib/common/TimeTest.kt
@@ -14,12 +14,12 @@
* GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
*/
-package net.taler.common
+package net.taler.lib.common
import kotlinx.serialization.UnstableDefault
import kotlinx.serialization.json.Json.Default.parse
import kotlinx.serialization.json.Json.Default.stringify
-import net.taler.common.Timestamp.Companion.NEVER
+import net.taler.lib.common.Timestamp.Companion.NEVER
import kotlin.random.Random
import kotlin.test.Test
import kotlin.test.assertEquals
diff --git a/common/src/commonTest/kotlin/net/taler/common/VersionTest.kt b/common/src/commonTest/kotlin/net/taler/lib/common/VersionTest.kt
index f4f17ea..b10b4bf 100644
--- a/common/src/commonTest/kotlin/net/taler/common/VersionTest.kt
+++ b/common/src/commonTest/kotlin/net/taler/lib/common/VersionTest.kt
@@ -14,7 +14,7 @@
* GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
*/
-package net.taler.common
+package net.taler.lib.common
import kotlin.test.Test
import kotlin.test.assertEquals