Repository: orchestr7/ktoml (kotlin)

Issue:
Support encoding for array of inline tables
There's a couple of tests for it:

```kotlin
    @Test
    @Ignore
    fun arrayOfInlineTablesText() {
        @Serializable
        data class InlineTable(val value: Long)

        @Serializable
        data class File(
            @TomlInlineTable
            val inlineTablesA: List<InlineTable> =
                    (0L..2L).map(::InlineTable),
            val inlineTablesB: @TomlInlineTable List<InlineTable> =
                    (3L..5L).map(::InlineTable),
            val inlineTablesC: List<@TomlInlineTable InlineTable> =
                    (6L..8L).map(::InlineTable)
        )

        assertEncodedEquals(
            value = File(),
            expectedToml = """
                inlineTablesA = [ { value = 0 }, { value = 1 }, { value = 2 } ]
                inlineTablesB = [ { value = 3 }, { value = 4 }, { value = 5 } ]
                inlineTablesC = [ { value = 6 }, { value = 7 }, { value = 8 } ]
            """.trimIndent()
        )
    }
```

```kotlin
    @Test
    @Ignore
    fun inlineTableArrayTest() {
        @Serializable
        @TomlInlineTable
        data class InlineTable(val index: Long)

        @Serializable
        data class InlineTableArray(
            @TomlMultiline
            val inlineTables: List<InlineTable> =
                    (0L..2L).map(::InlineTable)
        )

        assertEncodedEquals(
            value = InlineTableArray(),
            expectedToml = """
                inlineTables = [
                    { index = 0 },
                    { index = 1 },
                    { index = 2 }
                ]
            """.trimIndent()
        )
    }
```

Pull request:
Fixes #315 

Removed TYPE_PARAMETER and TYPE targets for @TomlInlineTable. I just couldn't get it to work and didn't find any examples in kotlinx.serialization. Anyway, all user scenarios are covered.


Also, I think we can get rid of TomlInlineTable and combine it with TomlTable. Is there any reason we shouldn't do it?

Patch:
diff --git a/ktoml-core/src/commonMain/kotlin/com/akuleshov7/ktoml/annotations/TomlInlineTable.kt b/ktoml-core/src/commonMain/kotlin/com/akuleshov7/ktoml/annotations/TomlInlineTable.kt
index e68054c2..97597757 100644
--- a/ktoml-core/src/commonMain/kotlin/com/akuleshov7/ktoml/annotations/TomlInlineTable.kt
+++ b/ktoml-core/src/commonMain/kotlin/com/akuleshov7/ktoml/annotations/TomlInlineTable.kt
@@ -1,6 +1,5 @@
 package com.akuleshov7.ktoml.annotations
 
-import kotlin.annotation.AnnotationTarget.*
 import kotlinx.serialization.ExperimentalSerializationApi
 import kotlinx.serialization.SerialInfo
 
@@ -12,7 +11,8 @@ import kotlinx.serialization.SerialInfo
  * data class Data(
  *     @TomlInlineTable
  *     val inlineTable: Table,
- *     val tableArray: List<@TomlInlineTable Table>,
+ *     @TomlInlineTable
+ *     val tableArray: List<Table>,
  *     val inlineTable2: Table2
  * )
  *
@@ -44,9 +44,7 @@ import kotlinx.serialization.SerialInfo
 @OptIn(ExperimentalSerializationApi::class)
 @SerialInfo
 @Target(
-    PROPERTY,
-    TYPE_PARAMETER,
-    CLASS,
-    TYPE
+    AnnotationTarget.PROPERTY,
+    AnnotationTarget.CLASS,
 )
 public annotation class TomlInlineTable
diff --git a/ktoml-core/src/commonMain/kotlin/com/akuleshov7/ktoml/encoders/TomlArrayEncoder.kt b/ktoml-core/src/commonMain/kotlin/com/akuleshov7/ktoml/encoders/TomlArrayEncoder.kt
index 58b58179..b0638c10 100644
--- a/ktoml-core/src/commonMain/kotlin/com/akuleshov7/ktoml/encoders/TomlArrayEncoder.kt
+++ b/ktoml-core/src/commonMain/kotlin/com/akuleshov7/ktoml/encoders/TomlArrayEncoder.kt
@@ -2,11 +2,11 @@ package com.akuleshov7.ktoml.encoders
 
 import com.akuleshov7.ktoml.TomlOutputConfig
 import com.akuleshov7.ktoml.exceptions.InternalEncodingException
-import com.akuleshov7.ktoml.exceptions.UnsupportedEncodingFeatureException
 import com.akuleshov7.ktoml.tree.nodes.*
 import com.akuleshov7.ktoml.tree.nodes.pairs.keys.TomlKey
 import com.akuleshov7.ktoml.tree.nodes.pairs.values.TomlArray
 import com.akuleshov7.ktoml.tree.nodes.pairs.values.TomlValue
+import com.akuleshov7.ktoml.tree.nodes.tables.InlineTableType
 import kotlinx.serialization.ExperimentalSerializationApi
 import kotlinx.serialization.descriptors.PolymorphicKind
 import kotlinx.serialization.descriptors.SerialDescriptor
@@ -95,10 +95,16 @@ public class TomlArrayEncoder internal constructor(
             is PolymorphicKind ->
                 // Nested primitive array
                 arrayEncoder(rootNode, attributes)
-            else ->
-                throw UnsupportedEncodingFeatureException(
-                    "Inline tables are not yet supported as array elements."
+            else -> {
+                val element = TomlArrayOfTablesElement(
+                    elementIndex,
+                    attributes.comments,
+                    attributes.inlineComment
                 )
+
+                tables += element
+                inlineTableEncoder(element)
+            }
         }
     } else {
         val element = TomlArrayOfTablesElement(
@@ -119,7 +125,7 @@ public class TomlArrayEncoder internal constructor(
     }
 
     override fun endStructure(descriptor: SerialDescriptor) {
-        if (attributes.isInline) {
+        if (attributes.isInline && tables.isEmpty()) {
             val array = TomlArray(values, attributes.isMultiline)
 
             parent?.let {
@@ -163,14 +169,31 @@ public class TomlArrayEncoder internal constructor(
             }
         }
 
-        val tableArray = TomlTable(
-            TomlKey(attributes.parent!!.getFullKey(), elementIndex),
-            elementIndex,
-            type = TableType.ARRAY,
-            isSynthetic = isSynthetic
-        )
+        appendParentalTable(isSynthetic)
+    }
 
-        tables.forEach(tableArray::appendChild)
+    private fun appendParentalTable(isSynthetic: Boolean) {
+        val allChildren = tables.flatMap { it.children }
+        val tableArray = if (allChildren.any { it is TomlInlineTable && it.key == null }) {
+            TomlInlineTable(
+                key = TomlKey(attributes.parent!!.key!!, elementIndex),
+                tomlKeyValues = tables,
+                inlineTableType = InlineTableType.ARRAY,
+                lineNo = elementIndex,
+                comments = emptyList(),
+                inlineComment = "",
+                multiline = attributes.isMultiline,
+            )
+        } else {
+            TomlTable(
+                TomlKey(attributes.parent!!.getFullKey(), elementIndex),
+                elementIndex,
+                type = TableType.ARRAY,
+                isSynthetic = isSynthetic
+            ).apply {
+                tables.forEach(this::appendChild)
+            }
+        }
 
         rootNode.appendChild(tableArray)
     }
diff --git a/ktoml-core/src/commonMain/kotlin/com/akuleshov7/ktoml/encoders/TomlInlineTableEncoder.kt b/ktoml-core/src/commonMain/kotlin/com/akuleshov7/ktoml/encoders/TomlInlineTableEncoder.kt
index f8c31966..bf820b7b 100644
--- a/ktoml-core/src/commonMain/kotlin/com/akuleshov7/ktoml/encoders/TomlInlineTableEncoder.kt
+++ b/ktoml-core/src/commonMain/kotlin/com/akuleshov7/ktoml/encoders/TomlInlineTableEncoder.kt
@@ -2,13 +2,11 @@ package com.akuleshov7.ktoml.encoders
 
 import com.akuleshov7.ktoml.TomlOutputConfig
 import com.akuleshov7.ktoml.exceptions.InternalEncodingException
-import com.akuleshov7.ktoml.tree.nodes.TomlInlineTable
-import com.akuleshov7.ktoml.tree.nodes.TomlKeyValueArray
-import com.akuleshov7.ktoml.tree.nodes.TomlKeyValuePrimitive
-import com.akuleshov7.ktoml.tree.nodes.TomlNode
+import com.akuleshov7.ktoml.tree.nodes.*
 import com.akuleshov7.ktoml.tree.nodes.pairs.keys.TomlKey
 import com.akuleshov7.ktoml.tree.nodes.pairs.values.TomlArray
 import com.akuleshov7.ktoml.tree.nodes.pairs.values.TomlValue
+import com.akuleshov7.ktoml.tree.nodes.tables.InlineTableType
 import kotlinx.serialization.ExperimentalSerializationApi
 import kotlinx.serialization.descriptors.SerialDescriptor
 import kotlinx.serialization.descriptors.SerialKind
@@ -102,21 +100,25 @@ public class TomlInlineTableEncoder internal constructor(
 
     override fun beginStructure(descriptor: SerialDescriptor): CompositeEncoder {
         val (_, _, _, _, _, _, comments, inlineComment) = attributes
-        val name = attributes.keyOrThrow()
+
+        val tomlKey = if (parent !is TomlArrayEncoder) {
+            TomlKey(attributes.keyOrThrow(), elementIndex)
+        } else {
+            null
+        }
 
         val inlineTable = TomlInlineTable(
-            TomlKey(name, elementIndex),
-            pairs,
-            elementIndex,
-            comments,
-            inlineComment
+            key = tomlKey,
+            tomlKeyValues = pairs,
+            inlineTableType = InlineTableType.PRIMITIVE,
+            lineNo = elementIndex,
+            comments = comments,
+            inlineComment = inlineComment,
         )
 
         when (parent) {
             is TomlInlineTableEncoder -> parent.pairs += inlineTable
-            is TomlArrayEncoder -> {
-                // Todo: Implement this when inline table arrays are supported.
-            }
+            is TomlArrayEncoder -> rootNode.appendChild(inlineTable)
             else -> rootNode.appendChild(inlineTable)
         }
 
@@ -143,21 +145,23 @@ public class TomlInlineTableEncoder internal constructor(
                 child.value,
                 child.lineNo,
                 child.comments,
-                child.inlineComment
+                child.inlineComment,
             )
             is TomlKeyValueArray -> TomlKeyValueArray(
                 TomlKey(name, child.lineNo),
                 child.value,
                 child.lineNo,
                 child.comments,
-                child.inlineComment
+                child.inlineComment,
             )
             is TomlInlineTable -> TomlInlineTable(
-                TomlKey(name, elementIndex),
-                child.tomlKeyValues,
-                child.lineNo,
-                child.comments,
-                child.inlineComment
+                key = TomlKey(name, elementIndex),
+                tomlKeyValues = child.tomlKeyValues,
+                inlineTableType = InlineTableType.PRIMITIVE,
+                lineNo = child.lineNo,
+                comments = child.comments,
+                inlineComment = child.inlineComment,
+                multiline = child.multiline,
             )
             else -> throw InternalEncodingException("Tried to encode $child as a pair, but it has unknown type.")
         }
diff --git a/ktoml-core/src/commonMain/kotlin/com/akuleshov7/ktoml/tree/nodes/tables/InlineTableType.kt b/ktoml-core/src/commonMain/kotlin/com/akuleshov7/ktoml/tree/nodes/tables/InlineTableType.kt
new file mode 100644
index 00000000..72218d44
--- /dev/null
+++ b/ktoml-core/src/commonMain/kotlin/com/akuleshov7/ktoml/tree/nodes/tables/InlineTableType.kt
@@ -0,0 +1,11 @@
+package com.akuleshov7.ktoml.tree.nodes.tables
+
+/**
+ * Type of inline table: primitive = "table = { a = 5, b = 6 }" or array: "table_arr = [ { a = 5 }, { a = 6 } ]"
+ *
+ */
+public enum class InlineTableType {
+    ARRAY,
+    PRIMITIVE,
+    ;
+}
diff --git a/ktoml-core/src/commonMain/kotlin/com/akuleshov7/ktoml/tree/nodes/tables/TomlInlineTable.kt b/ktoml-core/src/commonMain/kotlin/com/akuleshov7/ktoml/tree/nodes/tables/TomlInlineTable.kt
index f6bfdcfc..5e2fd827 100644
--- a/ktoml-core/src/commonMain/kotlin/com/akuleshov7/ktoml/tree/nodes/tables/TomlInlineTable.kt
+++ b/ktoml-core/src/commonMain/kotlin/com/akuleshov7/ktoml/tree/nodes/tables/TomlInlineTable.kt
@@ -5,6 +5,7 @@ import com.akuleshov7.ktoml.TomlOutputConfig
 import com.akuleshov7.ktoml.exceptions.ParseException
 import com.akuleshov7.ktoml.parsers.*
 import com.akuleshov7.ktoml.tree.nodes.pairs.keys.TomlKey
+import com.akuleshov7.ktoml.tree.nodes.tables.InlineTableType
 import com.akuleshov7.ktoml.writers.TomlEmitter
 
 /**
@@ -13,12 +14,16 @@ import com.akuleshov7.ktoml.writers.TomlEmitter
  * @param lineNo
  * @param comments
  * @param inlineComment
+ * @param inlineTableType type of inline table (primitive or array)
  * @property tomlKeyValues The key-value pairs in the inline table
- * @property key
+ * @property multiline whether the inline table should be written in multiple lines
+ * @property key null when this inline table is part of array of tables
  */
 public class TomlInlineTable internal constructor(
-    public val key: TomlKey,
+    public val key: TomlKey?,
     internal val tomlKeyValues: List<TomlNode>,
+    private val inlineTableType: InlineTableType,
+    public val multiline: Boolean = false,
     lineNo: Int,
     comments: List<String> = emptyList(),
     inlineComment: String = ""
@@ -35,13 +40,17 @@ public class TomlInlineTable internal constructor(
         lineNo: Int,
         comments: List<String> = emptyList(),
         inlineComment: String = "",
-        config: TomlInputConfig = TomlInputConfig()
+        config: TomlInputConfig = TomlInputConfig(),
+        inlineTableType: InlineTableType = InlineTableType.PRIMITIVE,
+        multiline: Boolean = false,
     ) : this(
         TomlKey(keyValuePair.first, lineNo),
         keyValuePair.second.parseInlineTableValue(keyValuePair, lineNo, config),
+        inlineTableType,
+        multiline,
         lineNo,
         comments,
-        inlineComment
+        inlineComment,
     )
 
     public fun returnTable(tomlFileHead: TomlFile, currentParentalNode: TomlNode): TomlTable {
@@ -77,31 +86,62 @@ public class TomlInlineTable internal constructor(
         emitter: TomlEmitter,
         config: TomlOutputConfig
     ) {
-        key.write(emitter)
+        key?.let {
+            it.write(emitter)
+            emitter.emitPairDelimiter()
+        }
 
-        emitter.emitPairDelimiter()
-            .startInlineTable()
+        when (inlineTableType) {
+            InlineTableType.PRIMITIVE -> emitter.startInlineTable()
+            InlineTableType.ARRAY -> emitter.startArray()
+        }
 
+        val isMultiline = multiline && inlineTableType == InlineTableType.ARRAY
+        if (isMultiline) {
+            emitter.indent()
+        }
         tomlKeyValues.forEachIndexed { i, pair ->
             if (i > 0) {
                 emitter.emitElementDelimiter()
             }
-
-            emitter.emitWhitespace()
+            if (isMultiline) {
+                emitter.emitNewLine()
+            } else {
+                emitter.emitWhitespace()
+            }
 
             pair.write(emitter, config)
         }
+        if (isMultiline) {
+            emitter.dedent()
+        }
 
-        emitter.emitWhitespace()
-            .endInlineTable()
+        if (!isMultiline) {
+            emitter.emitWhitespace()
+        }
+
+        writeEnding(emitter, isMultiline)
+    }
+
+    private fun writeEnding(emitter: TomlEmitter, isMultiline: Boolean) {
+        when (inlineTableType) {
+            InlineTableType.PRIMITIVE -> emitter.endInlineTable()
+            InlineTableType.ARRAY -> {
+                if (isMultiline) {
+                    emitter.emitNewLine()
+                }
+                emitter.emitIndent()
+                    .endArray()
+            }
+        }
     }
 
     private fun createTableRoot(currentParentalNode: TomlNode): TomlTable = TomlTable(
         TomlKey(
             when (currentParentalNode) {
-                is TomlTable -> currentParentalNode.fullTableKey.keyParts + key.keyParts
+                is TomlTable -> currentParentalNode.fullTableKey.keyParts + key!!.keyParts
                 is TomlArrayOfTablesElement -> (currentParentalNode.parent as TomlTable)
-                    .fullTableKey.keyParts + key.keyParts
+                    .fullTableKey.keyParts + key!!.keyParts
                 else -> listOf(name)
             },
         ),


Test patch:
diff --git a/ktoml-core/src/commonTest/kotlin/com/akuleshov7/ktoml/encoders/ArrayEncoderTest.kt b/ktoml-core/src/commonTest/kotlin/com/akuleshov7/ktoml/encoders/ArrayEncoderTest.kt
index 0900c923..69faaa72 100644
--- a/ktoml-core/src/commonTest/kotlin/com/akuleshov7/ktoml/encoders/ArrayEncoderTest.kt
+++ b/ktoml-core/src/commonTest/kotlin/com/akuleshov7/ktoml/encoders/ArrayEncoderTest.kt
@@ -2,9 +2,7 @@ package com.akuleshov7.ktoml.encoders
 
 import com.akuleshov7.ktoml.annotations.TomlInlineTable
 import com.akuleshov7.ktoml.annotations.TomlLiteral
-import com.akuleshov7.ktoml.annotations.TomlMultiline
 import kotlinx.serialization.Serializable
-import kotlin.test.Ignore
 import kotlin.test.Test
 
 class ArrayEncoderTest {
@@ -54,32 +52,6 @@ class ArrayEncoderTest {
         )
     }
 
-    @Test
-    @Ignore
-    fun inlineTableArrayTest() {
-        @Serializable
-        @TomlInlineTable
-        data class InlineTable(val index: Long)
-
-        @Serializable
-        data class InlineTableArray(
-            @TomlMultiline
-            val inlineTables: List<InlineTable> =
-                    (0L..2L).map(::InlineTable)
-        )
-
-        assertEncodedEquals(
-            value = InlineTableArray(),
-            expectedToml = """
-                inlineTables = [
-                    { index = 0 },
-                    { index = 1 },
-                    { index = 2 }
-                ]
-            """.trimIndent()
-        )
-    }
-
     @Test
     fun nestedArrayTest() {
         @Serializable
diff --git a/ktoml-core/src/commonTest/kotlin/com/akuleshov7/ktoml/encoders/ArrayOfInlineTablesEncoderTest.kt b/ktoml-core/src/commonTest/kotlin/com/akuleshov7/ktoml/encoders/ArrayOfInlineTablesEncoderTest.kt
new file mode 100644
index 00000000..6241ec1b
--- /dev/null
+++ b/ktoml-core/src/commonTest/kotlin/com/akuleshov7/ktoml/encoders/ArrayOfInlineTablesEncoderTest.kt
@@ -0,0 +1,134 @@
+package com.akuleshov7.ktoml.encoders
+
+import com.akuleshov7.ktoml.annotations.TomlInlineTable
+import com.akuleshov7.ktoml.annotations.TomlMultiline
+import kotlinx.serialization.Serializable
+import kotlin.test.Test
+
+class ArrayOfInlineTablesEncoderTest {
+
+    @Test
+    fun inlineTableArrayTest() {
+        @Serializable
+        @TomlInlineTable
+        data class InlineTable(val index1: Long, val index2: Long)
+
+        @Serializable
+        data class InlineTableArray(
+            val inlineTables: List<InlineTable> =
+                (0L..3L).map { it -> InlineTable(it, it)}
+        )
+
+        assertEncodedEquals(
+            value = InlineTableArray(),
+            expectedToml = """
+                inlineTables = [ { index1 = 0, index2 = 0 }, { index1 = 1, index2 = 1 }, { index1 = 2, index2 = 2 }, { index1 = 3, index2 = 3 } ]
+            """.trimIndent()
+        )
+    }
+
+    @Serializable
+    @TomlInlineTable
+    data class InlineTable(val index1: Long, val index2: Long)
+
+    @Serializable
+    data class InlineTableArray(
+        @TomlMultiline
+        val inlineTables: List<InlineTable> =
+            (0L..3L).map { it -> InlineTable(it, it)}
+    )
+
+    @Test
+    fun multilineInlineTableArrayTest() {
+        assertEncodedEquals(
+            value = InlineTableArray(),
+            expectedToml = """
+                inlineTables = [
+                    { index1 = 0, index2 = 0 },
+                    { index1 = 1, index2 = 1 },
+                    { index1 = 2, index2 = 2 },
+                    { index1 = 3, index2 = 3 }
+                ]
+            """.trimIndent()
+        )
+    }
+
+    @Test
+    fun inlineTableArrayInsideTable() {
+        @Serializable
+        data class Container(
+            val table: InlineTableArray = InlineTableArray(),
+            val int: Int = 2,
+        )
+
+        assertEncodedEquals(
+            value = Container(),
+            expectedToml = """
+                int = 2
+                
+                [table]
+                    inlineTables = [
+                        { index1 = 0, index2 = 0 },
+                        { index1 = 1, index2 = 1 },
+                        { index1 = 2, index2 = 2 },
+                        { index1 = 3, index2 = 3 }
+                    ]
+            """.trimIndent()
+        )
+    }
+
+    @Test
+    fun inlineTableArrayInsideTableArrayTest() {
+        @Serializable
+        data class Container(val tables: List<InlineTableArray> = listOf(InlineTableArray(), InlineTableArray()))
+
+        assertEncodedEquals(
+            value = Container(),
+            expectedToml = """
+                [[tables]]
+                    inlineTables = [
+                        { index1 = 0, index2 = 0 },
+                        { index1 = 1, index2 = 1 },
+                        { index1 = 2, index2 = 2 },
+                        { index1 = 3, index2 = 3 }
+                    ]
+                
+                [[tables]]
+                    inlineTables = [
+                        { index1 = 0, index2 = 0 },
+                        { index1 = 1, index2 = 1 },
+                        { index1 = 2, index2 = 2 },
+                        { index1 = 3, index2 = 3 }
+                    ]
+            """.trimIndent()
+        )
+    }
+
+    @Test
+    fun withAnnotationTargetOnProperty() {
+        @Serializable
+        data class InlineTable(val value: Long)
+
+        @Serializable
+        data class File(
+            @TomlInlineTable
+            val inlineTablesA: List<InlineTable> =
+                (0L..2L).map(::InlineTable),
+        )
+
+        assertEncodedEquals(
+            value = File(),
+            expectedToml = """
+                inlineTablesA = [ { value = 0 }, { value = 1 }, { value = 2 } ]
+            """.trimIndent()
+        )
+    }
+
+    @Test
+    fun emptyInlineTableArrayTest() {
+        assertEncodedEquals(
+            value = InlineTableArray(inlineTables = emptyList()),
+            expectedToml = "",
+        )
+    }
+}
diff --git a/ktoml-core/src/commonTest/kotlin/com/akuleshov7/ktoml/encoders/EncodingAnnotationTest.kt b/ktoml-core/src/commonTest/kotlin/com/akuleshov7/ktoml/encoders/EncodingAnnotationTest.kt
index 4bb49b8d..add1ac7b 100644
--- a/ktoml-core/src/commonTest/kotlin/com/akuleshov7/ktoml/encoders/EncodingAnnotationTest.kt
+++ b/ktoml-core/src/commonTest/kotlin/com/akuleshov7/ktoml/encoders/EncodingAnnotationTest.kt
@@ -7,7 +7,6 @@ import com.akuleshov7.ktoml.writers.IntegerRepresentation.*
 import kotlinx.serialization.EncodeDefault
 import kotlinx.serialization.ExperimentalSerializationApi
 import kotlinx.serialization.Serializable
-import kotlin.test.Ignore
 import kotlin.test.Test
 
 class EncodingAnnotationTest {
@@ -131,33 +130,6 @@ class EncodingAnnotationTest {
         )
     }
 
-    @Test
-    @Ignore
-    fun arrayOfInlineTablesText() {
-        @Serializable
-        data class InlineTable(val value: Long)
-
-        @Serializable
-        data class File(
-            @TomlInlineTable
-            val inlineTablesA: List<InlineTable> =
-                    (0L..2L).map(::InlineTable),
-            val inlineTablesB: @TomlInlineTable List<InlineTable> =
-                    (3L..5L).map(::InlineTable),
-            val inlineTablesC: List<@TomlInlineTable InlineTable> =
-                    (6L..8L).map(::InlineTable)
-        )
-
-        assertEncodedEquals(
-            value = File(),
-            expectedToml = """
-                inlineTablesA = [ { value = 0 }, { value = 1 }, { value = 2 } ]
-                inlineTablesB = [ { value = 3 }, { value = 4 }, { value = 5 } ]
-                inlineTablesC = [ { value = 6 }, { value = 7 }, { value = 8 } ]
-            """.trimIndent()
-        )
-    }
-
     @Test
     fun multilineArrayTest() {
         @Serializable