-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
208 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
157 changes: 82 additions & 75 deletions
157
tests/src/test/kotlin/se/ansman/kotshi/BaseGeneratorTest.kt
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
tests/src/test/kotlin/se/ansman/kotshi/IgnoredPropertiesTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
tests/src/test/kotlin/se/ansman/kotshi/SealedClassWithComplexGenericTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
tests/src/test/kotlin/se/ansman/kotshi/SealedClassWithGenericTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
tests/src/test/kotlin/se/ansman/kotshi/assertions/arrays.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
@file:OptIn(ExperimentalUnsignedTypes::class) | ||
|
||
package se.ansman.kotshi.assertions | ||
|
||
import assertk.Assert | ||
import assertk.assertions.isTrue | ||
import assertk.assertions.prop | ||
|
||
@JvmName("isBooleanArrayEmpty") | ||
fun Assert<BooleanArray>.isEmpty() { | ||
prop(BooleanArray::isEmpty).isTrue() | ||
} | ||
|
||
@JvmName("isByteArrayEmpty") | ||
fun Assert<ByteArray>.isEmpty() { | ||
prop(ByteArray::isEmpty).isTrue() | ||
} | ||
|
||
@JvmName("isUByteArrayEmpty") | ||
fun Assert<UByteArray>.isEmpty() { | ||
prop(UByteArray::isEmpty).isTrue() | ||
} | ||
|
||
@JvmName("isCharArrayEmpty") | ||
fun Assert<CharArray>.isEmpty() { | ||
prop(CharArray::isEmpty).isTrue() | ||
} | ||
|
||
@JvmName("isShortArrayEmpty") | ||
fun Assert<ShortArray>.isEmpty() { | ||
prop(ShortArray::isEmpty).isTrue() | ||
} | ||
|
||
@JvmName("isUShortArrayEmpty") | ||
fun Assert<UShortArray>.isEmpty() { | ||
prop(UShortArray::isEmpty).isTrue() | ||
} | ||
|
||
@JvmName("isIntArrayEmpty") | ||
fun Assert<IntArray>.isEmpty() { | ||
prop(IntArray::isEmpty).isTrue() | ||
} | ||
|
||
@JvmName("isUIntArrayEmpty") | ||
fun Assert<UIntArray>.isEmpty() { | ||
prop(UIntArray::isEmpty).isTrue() | ||
} | ||
|
||
@JvmName("isLongArrayEmpty") | ||
fun Assert<LongArray>.isEmpty() { | ||
prop(LongArray::isEmpty).isTrue() | ||
} | ||
|
||
@JvmName("isULongArrayEmpty") | ||
fun Assert<ULongArray>.isEmpty() { | ||
prop(ULongArray::isEmpty).isTrue() | ||
} | ||
|
||
@JvmName("isFloatArrayEmpty") | ||
fun Assert<FloatArray>.isEmpty() { | ||
prop(FloatArray::isEmpty).isTrue() | ||
} | ||
|
||
@JvmName("isDoubleArrayEmpty") | ||
fun Assert<DoubleArray>.isEmpty() { | ||
prop(DoubleArray::isEmpty).isTrue() | ||
} | ||
|
||
@JvmName("isArrayEmpty") | ||
fun Assert<Array<*>>.isEmpty() { | ||
prop(Array<*>::isEmpty).isTrue() | ||
} |
16 changes: 16 additions & 0 deletions
16
tests/src/test/kotlin/se/ansman/kotshi/assertions/classes.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package se.ansman.kotshi.assertions | ||
|
||
import assertk.Assert | ||
import assertk.assertions.support.expected | ||
|
||
inline fun <reified T : Any> Assert<Class<*>>.isAssignableTo() { | ||
isAssignableTo(T::class.java) | ||
} | ||
|
||
fun Assert<Class<*>>.isAssignableTo(other: Class<*>) { | ||
given { | ||
if (!other.isAssignableFrom(it)) { | ||
expected("$it to be assignable to $other") | ||
} | ||
} | ||
} |