Skip to content

Commit

Permalink
Use Parameterize instead of Kotest property testing (move files)
Browse files Browse the repository at this point in the history
Reorganize the test files after the Parameterize refactor, as a separate
commit so their history is preserved.
- Parameter files    -> /test/parameters/*Parameters.kt
- /test/data/*Nbt.kt -> /test/file/*Nbt.kt
  • Loading branch information
BenWoodworth committed May 23, 2024
1 parent fa308d9 commit ccca50f
Show file tree
Hide file tree
Showing 21 changed files with 32 additions and 29 deletions.
2 changes: 1 addition & 1 deletion src/commonTest/kotlin/NbtTagTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import com.benwoodworth.parameterize.ParameterizeScope
import com.benwoodworth.parameterize.parameter
import com.benwoodworth.parameterize.parameterOf
import net.benwoodworth.knbt.test.filter
import net.benwoodworth.knbt.test.generators.*
import net.benwoodworth.knbt.test.parameterizeTest
import net.benwoodworth.knbt.test.parameters.*
import kotlin.reflect.KProperty1
import kotlin.test.*

Expand Down
8 changes: 4 additions & 4 deletions src/commonTest/kotlin/NbtVariantJavaNetworkTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import kotlinx.serialization.decodeFromByteArray
import kotlinx.serialization.encodeToByteArray
import net.benwoodworth.knbt.okio.decodeFromBufferedSource
import net.benwoodworth.knbt.test.asSource
import net.benwoodworth.knbt.test.data.isEmptyNamedVersion
import net.benwoodworth.knbt.test.data.isUnnamedVersion
import net.benwoodworth.knbt.test.data.parameterOfNbtVariantEdgeCases
import net.benwoodworth.knbt.test.filter
import net.benwoodworth.knbt.test.generators.parameterOfNbtTagTypeEdgeCases
import net.benwoodworth.knbt.test.parameterizeTest
import net.benwoodworth.knbt.test.parameters.isEmptyNamedVersion
import net.benwoodworth.knbt.test.parameters.isUnnamedVersion
import net.benwoodworth.knbt.test.parameters.parameterOfNbtTagTypeEdgeCases
import net.benwoodworth.knbt.test.parameters.parameterOfNbtVariantEdgeCases
import okio.buffer
import kotlin.test.*

Expand Down
2 changes: 1 addition & 1 deletion src/commonTest/kotlin/internal/BinaryNbtWriterTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import net.benwoodworth.knbt.test.TestSink
import net.benwoodworth.knbt.test.asSource
import net.benwoodworth.knbt.test.file.nbtFiles
import net.benwoodworth.knbt.test.filter
import net.benwoodworth.knbt.test.generators.parameterOfNbtTagTypeEdgeCases
import net.benwoodworth.knbt.test.parameterizeTest
import net.benwoodworth.knbt.test.parameters.parameterOfNbtTagTypeEdgeCases
import okio.blackholeSink
import okio.buffer
import okio.use
Expand Down
2 changes: 1 addition & 1 deletion src/commonTest/kotlin/internal/NbtTagTypeTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package net.benwoodworth.knbt.internal
import com.benwoodworth.parameterize.parameter
import net.benwoodworth.knbt.*
import net.benwoodworth.knbt.test.filter
import net.benwoodworth.knbt.test.parameterOfBytes
import net.benwoodworth.knbt.test.parameterizeTest
import net.benwoodworth.knbt.test.parameters.parameterOfBytes
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertNull
Expand Down
2 changes: 1 addition & 1 deletion src/commonTest/kotlin/internal/SerialDescriptorTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import kotlinx.serialization.descriptors.buildClassSerialDescriptor
import kotlinx.serialization.descriptors.buildSerialDescriptor
import kotlinx.serialization.serializer
import net.benwoodworth.knbt.NbtArray
import net.benwoodworth.knbt.test.parameterOfBooleans
import net.benwoodworth.knbt.test.parameterizeTest
import net.benwoodworth.knbt.test.parameters.parameterOfBooleans
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertFailsWith
Expand Down
4 changes: 2 additions & 2 deletions src/commonTest/kotlin/internal/StringifiedNbtWriterTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package net.benwoodworth.knbt.internal
import kotlinx.serialization.encodeToString
import net.benwoodworth.knbt.ExperimentalNbtApi
import net.benwoodworth.knbt.StringifiedNbt
import net.benwoodworth.knbt.test.data.bigTestExtendedTag
import net.benwoodworth.knbt.test.data.testTag
import net.benwoodworth.knbt.test.file.bigTestExtendedTag
import net.benwoodworth.knbt.test.file.testTag
import net.benwoodworth.knbt.test.fix
import kotlin.test.Test
import kotlin.test.assertEquals
Expand Down
2 changes: 1 addition & 1 deletion src/commonTest/kotlin/internal/StringsTest.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package net.benwoodworth.knbt.internal

import net.benwoodworth.knbt.test.parameterOfBytes
import net.benwoodworth.knbt.test.parameterizeTest
import net.benwoodworth.knbt.test.parameters.parameterOfBytes
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertTrue
Expand Down
7 changes: 5 additions & 2 deletions src/commonTest/kotlin/internal/TreeNbtReaderTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ package net.benwoodworth.knbt.internal
import net.benwoodworth.knbt.*
import net.benwoodworth.knbt.internal.NbtReader.*
import net.benwoodworth.knbt.internal.NbtTagType.*
import net.benwoodworth.knbt.test.*
import net.benwoodworth.knbt.test.data.*
import net.benwoodworth.knbt.test.NbtFormat
import net.benwoodworth.knbt.test.file.*
import net.benwoodworth.knbt.test.parameterizeTest
import net.benwoodworth.knbt.test.parameters.*
import net.benwoodworth.knbt.test.shouldReturn
import kotlin.test.Test

class TreeNbtReaderTest {
Expand Down
8 changes: 5 additions & 3 deletions src/commonTest/kotlin/internal/TreeNbtWriterTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ package net.benwoodworth.knbt.internal

import net.benwoodworth.knbt.*
import net.benwoodworth.knbt.internal.NbtTagType.*
import net.benwoodworth.knbt.test.*
import net.benwoodworth.knbt.test.data.testClass
import net.benwoodworth.knbt.test.data.testTag
import net.benwoodworth.knbt.test.NbtFormat
import net.benwoodworth.knbt.test.file.testClass
import net.benwoodworth.knbt.test.file.testTag
import net.benwoodworth.knbt.test.parameterizeTest
import net.benwoodworth.knbt.test.parameters.*
import kotlin.test.Test
import kotlin.test.assertEquals

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import net.benwoodworth.knbt.NbtNamed
import net.benwoodworth.knbt.buildNbtCompound
import net.benwoodworth.knbt.put
import net.benwoodworth.knbt.putNbtCompound
import net.benwoodworth.knbt.test.data.*
import net.benwoodworth.knbt.test.file.*
import kotlin.test.Test

class ClassSerializationTest : SerializationTest() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ import kotlinx.serialization.builtins.serializer
import net.benwoodworth.knbt.NbtByte
import net.benwoodworth.knbt.NbtString
import net.benwoodworth.knbt.fromBoolean
import net.benwoodworth.knbt.test.generators.*
import net.benwoodworth.knbt.test.parameterOfBooleans
import net.benwoodworth.knbt.test.parameterizeTest
import net.benwoodworth.knbt.test.parameters.*
import net.benwoodworth.knbt.toBoolean
import kotlin.test.Test

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.benwoodworth.knbt.test.data
package net.benwoodworth.knbt.test.file

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.benwoodworth.knbt.test.data
package net.benwoodworth.knbt.test.file

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
Expand Down
1 change: 0 additions & 1 deletion src/commonTest/kotlin/test/file/NbtTestFiles.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import net.benwoodworth.knbt.Nbt
import net.benwoodworth.knbt.NbtCompression
import net.benwoodworth.knbt.NbtVariant
import net.benwoodworth.knbt.test.asSource
import net.benwoodworth.knbt.test.data.*
import okio.Source

class NbtTestFile<T>(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.benwoodworth.knbt.test.data
package net.benwoodworth.knbt.test.file

import kotlinx.serialization.Serializable
import net.benwoodworth.knbt.NbtCompound
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.benwoodworth.knbt.test.generators
package net.benwoodworth.knbt.test.parameters

import com.benwoodworth.parameterize.ParameterizeScope
import com.benwoodworth.parameterize.parameter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.benwoodworth.knbt.test.generators
package net.benwoodworth.knbt.test.parameters

import com.benwoodworth.parameterize.ParameterizeScope
import com.benwoodworth.parameterize.parameter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.benwoodworth.knbt.test.generators
package net.benwoodworth.knbt.test.parameters

import com.benwoodworth.parameterize.ParameterizeScope
import com.benwoodworth.parameterize.parameter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.benwoodworth.knbt.test.generators
package net.benwoodworth.knbt.test.parameters

import com.benwoodworth.parameterize.ParameterizeScope
import com.benwoodworth.parameterize.parameter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.benwoodworth.knbt.test.data
package net.benwoodworth.knbt.test.parameters

import com.benwoodworth.parameterize.ParameterizeScope
import com.benwoodworth.parameterize.parameter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.benwoodworth.knbt.test
package net.benwoodworth.knbt.test.parameters

import com.benwoodworth.parameterize.ParameterizeScope
import com.benwoodworth.parameterize.parameter
Expand Down

0 comments on commit ccca50f

Please sign in to comment.