Get rid of MultiPlatform Code, pt 1.

This commit is contained in:
Oliver Rümpelein 2020-04-19 12:09:50 +02:00
parent 3913c4af76
commit e74840fb6a
7 changed files with 3 additions and 37 deletions

View file

@ -3,16 +3,6 @@ package de.pheerai.rcdbquery
import de.pheerai.rcdbquery.dataMappings.* import de.pheerai.rcdbquery.dataMappings.*
import de.pheerai.rcdbquery.dsl.* import de.pheerai.rcdbquery.dsl.*
expect class Sample() {
fun checkMe(): Int
}
expect object Platform {
val name: String
}
fun hello(): String = "Hello from ${Platform.name}"
fun generateQueryUrl() = rcdbQuery { fun generateQueryUrl() = rcdbQuery {
searchFor(SearchType.COASTER) searchFor(SearchType.COASTER)
searchTerm("Dragon") searchTerm("Dragon")

View file

@ -6,6 +6,6 @@ import kotlin.test.assertTrue
class SampleTests { class SampleTests {
@Test @Test
fun testMe() { fun testMe() {
assertTrue(Sample().checkMe() > 0) assertTrue(true)
} }
} }

View file

@ -1,9 +1 @@
package de.pheerai.rcdbquery package de.pheerai.rcdbquery
actual class Sample {
actual fun checkMe() = 12
}
actual object Platform {
actual val name: String = "JS"
}

View file

@ -1,13 +1,5 @@
package de.pheerai.rcdbquery package de.pheerai.rcdbquery
actual class Sample {
actual fun checkMe() = 42
}
actual object Platform {
actual val name: String = "JVM"
}
fun main() { fun main() {
print(generateQueryUrl()) print(generateQueryUrl())
} }

View file

@ -6,6 +6,6 @@ import kotlin.test.assertTrue
class SampleTestsJVM { class SampleTestsJVM {
@Test @Test
fun testHello() { fun testHello() {
assertTrue("JVM" in hello()) assertTrue(true)
} }
} }

View file

@ -1,13 +1,5 @@
package de.pheerai.rcdbquery package de.pheerai.rcdbquery
actual class Sample {
actual fun checkMe() = 7
}
actual object Platform {
actual val name: String = "Native"
}
fun main() { fun main() {
println(generateQueryUrl()) println(generateQueryUrl())
} }

View file

@ -6,6 +6,6 @@ import kotlin.test.assertTrue
class SampleTestsNative { class SampleTestsNative {
@Test @Test
fun testHello() { fun testHello() {
assertTrue("Native" in hello()) assertTrue(true)
} }
} }