-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from GoNZooo/r.kotlin-basic-tests
testing(kt): add kotlin tests for "basic" suite of tests
- Loading branch information
Showing
17 changed files
with
314 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
# Changelog | ||
|
||
## 2.2.1 | ||
|
||
### Fixes | ||
|
||
- Added trailing newline in Kotlin output | ||
|
||
## 2.2.0 | ||
|
||
### Added | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,7 +50,7 @@ outputModule module' = | |
moduleClassOutput, | ||
definitionOutput, | ||
"\n", | ||
"}" | ||
"}\n" | ||
] | ||
|
||
modulePrelude :: Text | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -232,4 +232,4 @@ sealed class EmbeddedEvent : java.io.Serializable { | |
} | ||
} | ||
} | ||
} | ||
} |
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,31 @@ | ||
package org.gotynoOutput | ||
|
||
import com.fasterxml.jackson.annotation.* | ||
import com.fasterxml.jackson.module.kotlin.* | ||
import com.fasterxml.jackson.databind.annotation.* | ||
import com.fasterxml.jackson.databind.* | ||
import com.fasterxml.jackson.core.* | ||
import com.fasterxml.jackson.databind.deser.std.* | ||
import java.text.ParseException | ||
import java.math.BigInteger | ||
import kotlinx.serialization.Serializable | ||
|
||
class BasicEnumeration { | ||
enum class StringValues(val data: String) : java.io.Serializable { | ||
@JsonProperty("first") FIRST("first"), | ||
@JsonProperty("second") SECOND("second"), | ||
@JsonProperty("Third") THIRD("Third"), | ||
@JsonProperty("Fourth") FOURTH("Fourth"); | ||
|
||
companion object {} | ||
} | ||
|
||
enum class IntValues(val data: Int) : java.io.Serializable { | ||
@JsonProperty(1) FIRST(1), | ||
@JsonProperty(2) SECOND(2), | ||
@JsonProperty(3) THIRD(3), | ||
@JsonProperty(4) FOURTH(4); | ||
|
||
companion object {} | ||
} | ||
} |
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,35 @@ | ||
package org.gotynoOutput | ||
|
||
import com.fasterxml.jackson.annotation.* | ||
import com.fasterxml.jackson.module.kotlin.* | ||
import com.fasterxml.jackson.databind.annotation.* | ||
import com.fasterxml.jackson.databind.* | ||
import com.fasterxml.jackson.core.* | ||
import com.fasterxml.jackson.databind.deser.std.* | ||
import java.text.ParseException | ||
import java.math.BigInteger | ||
import kotlinx.serialization.Serializable | ||
|
||
import org.gotynoOutput.BasicStruct | ||
|
||
class BasicImport { | ||
@Serializable | ||
data class StructUsingImport( | ||
@get:JsonProperty("field") | ||
val field: BasicStruct.BasicStruct | ||
) : java.io.Serializable | ||
|
||
@Serializable | ||
@JsonTypeInfo( | ||
use = JsonTypeInfo.Id.NAME, | ||
include = JsonTypeInfo.As.EXISTING_PROPERTY, | ||
property = "type" | ||
) | ||
sealed class UnionUsingImport : java.io.Serializable { | ||
@Serializable | ||
@JsonTypeName("ConstructorWithPayload") | ||
data class ConstructorWithPayload(val data: BasicStruct.BasicStruct) : UnionUsingImport(), java.io.Serializable { | ||
val type = "ConstructorWithPayload" | ||
} | ||
} | ||
} |
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,49 @@ | ||
package org.gotynoOutput | ||
|
||
import com.fasterxml.jackson.annotation.* | ||
import com.fasterxml.jackson.module.kotlin.* | ||
import com.fasterxml.jackson.databind.annotation.* | ||
import com.fasterxml.jackson.databind.* | ||
import com.fasterxml.jackson.core.* | ||
import com.fasterxml.jackson.databind.deser.std.* | ||
import java.text.ParseException | ||
import java.math.BigInteger | ||
import kotlinx.serialization.Serializable | ||
|
||
class BasicOptional { | ||
@Serializable | ||
data class HasOptionalString( | ||
@get:JsonProperty("stringField") | ||
val stringField: String?, | ||
@get:JsonProperty("optionalArrayField") | ||
val optionalArrayField: ArrayList<Int>?, | ||
@get:JsonProperty("arrayOfOptionalField") | ||
val arrayOfOptionalField: ArrayList<Int?> | ||
) : java.io.Serializable | ||
|
||
@Serializable | ||
@JsonTypeInfo( | ||
use = JsonTypeInfo.Id.NAME, | ||
include = JsonTypeInfo.As.EXISTING_PROPERTY, | ||
property = "type" | ||
) | ||
sealed class HasOptionalConstructor : java.io.Serializable { | ||
@Serializable | ||
@JsonTypeName("DoesNot") | ||
data class DoesNot(val data: Int) : HasOptionalConstructor(), java.io.Serializable { | ||
val type = "DoesNot" | ||
} | ||
|
||
@Serializable | ||
@JsonTypeName("Does") | ||
data class Does(val data: Int?) : HasOptionalConstructor(), java.io.Serializable { | ||
val type = "Does" | ||
} | ||
|
||
@Serializable | ||
@JsonTypeName("HasOptionalStruct") | ||
data class HasOptionalStruct(val data: HasOptionalString?) : HasOptionalConstructor(), java.io.Serializable { | ||
val type = "HasOptionalStruct" | ||
} | ||
} | ||
} |
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,21 @@ | ||
package org.gotynoOutput | ||
|
||
import com.fasterxml.jackson.annotation.* | ||
import com.fasterxml.jackson.module.kotlin.* | ||
import com.fasterxml.jackson.databind.annotation.* | ||
import com.fasterxml.jackson.databind.* | ||
import com.fasterxml.jackson.core.* | ||
import com.fasterxml.jackson.databind.deser.std.* | ||
import java.text.ParseException | ||
import java.math.BigInteger | ||
import kotlinx.serialization.Serializable | ||
|
||
class BasicStruct { | ||
@Serializable | ||
data class BasicStruct( | ||
@get:JsonProperty("field1") | ||
val field1: Int, | ||
@get:JsonProperty("field2") | ||
val field2: String | ||
) : java.io.Serializable | ||
} |
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,53 @@ | ||
package org.gotynoOutput | ||
|
||
import com.fasterxml.jackson.annotation.* | ||
import com.fasterxml.jackson.module.kotlin.* | ||
import com.fasterxml.jackson.databind.annotation.* | ||
import com.fasterxml.jackson.databind.* | ||
import com.fasterxml.jackson.core.* | ||
import com.fasterxml.jackson.databind.deser.std.* | ||
import java.text.ParseException | ||
import java.math.BigInteger | ||
import kotlinx.serialization.Serializable | ||
|
||
class BasicUnion { | ||
@Serializable | ||
data class PayloadStruct( | ||
@get:JsonProperty("field1") | ||
val field1: Int | ||
) : java.io.Serializable | ||
|
||
@Serializable | ||
@JsonTypeInfo( | ||
use = JsonTypeInfo.Id.NAME, | ||
include = JsonTypeInfo.As.EXISTING_PROPERTY, | ||
property = "type" | ||
) | ||
sealed class BasicUnion : java.io.Serializable { | ||
@Serializable | ||
@JsonTypeName("HasStringPayload") | ||
data class HasStringPayload(val data: String) : BasicUnion(), java.io.Serializable { | ||
val type = "HasStringPayload" | ||
} | ||
|
||
@Serializable | ||
@JsonTypeName("HasPayload") | ||
data class HasPayload(val data: PayloadStruct) : BasicUnion(), java.io.Serializable { | ||
val type = "HasPayload" | ||
} | ||
|
||
@Serializable | ||
@JsonTypeName("HasNoPayload") | ||
class HasNoPayload : BasicUnion(), java.io.Serializable { | ||
val type = "HasNoPayload" | ||
|
||
override fun equals(other: Any?): Boolean { | ||
return other is HasNoPayload | ||
} | ||
|
||
override fun hashCode(): Int { | ||
return 0 | ||
} | ||
} | ||
} | ||
} |
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,19 @@ | ||
package org.gotynoOutput | ||
|
||
import com.fasterxml.jackson.annotation.* | ||
import com.fasterxml.jackson.module.kotlin.* | ||
import com.fasterxml.jackson.databind.annotation.* | ||
import com.fasterxml.jackson.databind.* | ||
import com.fasterxml.jackson.core.* | ||
import com.fasterxml.jackson.databind.deser.std.* | ||
import java.text.ParseException | ||
import java.math.BigInteger | ||
import kotlinx.serialization.Serializable | ||
|
||
class GenericStruct { | ||
@Serializable | ||
data class GenericStruct<T>( | ||
@get:JsonProperty("field") | ||
val field: T | ||
) : java.io.Serializable | ||
} |
Oops, something went wrong.