@@ -3,13 +3,13 @@ package it.krzeminski.githubactionstyping.validation
3
3
import io.kotest.core.spec.style.FunSpec
4
4
import io.kotest.matchers.shouldBe
5
5
import it.krzeminski.githubactionstyping.parsing.ApiItem
6
- import it.krzeminski.githubactionstyping.parsing.Manifest
6
+ import it.krzeminski.githubactionstyping.parsing.TypesManifest
7
7
8
8
class ManifestValidationTest : FunSpec ({
9
9
context("success cases") {
10
10
test("primitive types") {
11
11
// given
12
- val manifest = Manifest (
12
+ val manifest = TypesManifest (
13
13
typingSpec = expectedTypingSpec,
14
14
inputs = mapOf(
15
15
"string-input" to ApiItem (type = "string"),
@@ -38,7 +38,7 @@ class ManifestValidationTest : FunSpec({
38
38
39
39
test("enum type") {
40
40
// given
41
- val manifest = Manifest (
41
+ val manifest = TypesManifest (
42
42
typingSpec = expectedTypingSpec,
43
43
inputs = mapOf(
44
44
"enum-input" to ApiItem (type = "enum", allowedValues = listOf("foo", "bar", "baz")),
@@ -59,7 +59,7 @@ class ManifestValidationTest : FunSpec({
59
59
60
60
test("list type") {
61
61
// given
62
- val manifest = Manifest (
62
+ val manifest = TypesManifest (
63
63
typingSpec = expectedTypingSpec,
64
64
inputs = mapOf(
65
65
"list-of-strings-input" to ApiItem (
@@ -113,7 +113,7 @@ class ManifestValidationTest : FunSpec({
113
113
context("failure cases") {
114
114
test("no typing spec set") {
115
115
// given
116
- val manifest = Manifest (
116
+ val manifest = TypesManifest (
117
117
typingSpec = null,
118
118
inputs = emptyMap(),
119
119
outputs = emptyMap(),
@@ -134,7 +134,7 @@ class ManifestValidationTest : FunSpec({
134
134
135
135
test("incorrect typing spec set") {
136
136
// given
137
- val manifest = Manifest (
137
+ val manifest = TypesManifest (
138
138
typingSpec = "incorrect-typing-spec",
139
139
inputs = emptyMap(),
140
140
outputs = emptyMap(),
@@ -156,7 +156,7 @@ class ManifestValidationTest : FunSpec({
156
156
157
157
test("input and output without type") {
158
158
// given
159
- val manifest = Manifest (
159
+ val manifest = TypesManifest (
160
160
typingSpec = expectedTypingSpec,
161
161
inputs = mapOf(
162
162
"some-input" to ApiItem (type = null),
@@ -187,7 +187,7 @@ class ManifestValidationTest : FunSpec({
187
187
188
188
test("unknown type") {
189
189
// given
190
- val manifest = Manifest (
190
+ val manifest = TypesManifest (
191
191
typingSpec = expectedTypingSpec,
192
192
inputs = mapOf(
193
193
"some-input" to ApiItem (type = "for-sure-unknown-type"),
@@ -210,7 +210,7 @@ class ManifestValidationTest : FunSpec({
210
210
211
211
test("primitive types with 'allowedValues' attribute") {
212
212
// given
213
- val manifest = Manifest (
213
+ val manifest = TypesManifest (
214
214
typingSpec = expectedTypingSpec,
215
215
inputs = mapOf(
216
216
"string-input" to ApiItem (type = "string", allowedValues = listOf("foo", "bar")),
@@ -237,7 +237,7 @@ class ManifestValidationTest : FunSpec({
237
237
238
238
test("primitive types with 'separator' attribute") {
239
239
// given
240
- val manifest = Manifest (
240
+ val manifest = TypesManifest (
241
241
typingSpec = expectedTypingSpec,
242
242
inputs = mapOf(
243
243
"string-input" to ApiItem (type = "string", separator = ","),
@@ -264,7 +264,7 @@ class ManifestValidationTest : FunSpec({
264
264
265
265
test("non-list types with 'listItem' attribute") {
266
266
// given
267
- val manifest = Manifest (
267
+ val manifest = TypesManifest (
268
268
typingSpec = expectedTypingSpec,
269
269
inputs = mapOf(
270
270
"string-input" to ApiItem (type = "string", listItem = ApiItem (type = "string")),
@@ -297,7 +297,7 @@ class ManifestValidationTest : FunSpec({
297
297
298
298
test("enum type with 'separator' attribute") {
299
299
// given
300
- val manifest = Manifest (
300
+ val manifest = TypesManifest (
301
301
typingSpec = expectedTypingSpec,
302
302
inputs = mapOf(
303
303
"enum-input" to ApiItem (type = "enum", allowedValues = listOf("foo", "bar", "baz"), separator = ","),
@@ -318,7 +318,7 @@ class ManifestValidationTest : FunSpec({
318
318
319
319
test("enum type without 'allowedValues' attribute") {
320
320
// given
321
- val manifest = Manifest (
321
+ val manifest = TypesManifest (
322
322
typingSpec = expectedTypingSpec,
323
323
inputs = mapOf(
324
324
"enum-input" to ApiItem (type = "enum", allowedValues = null),
@@ -339,7 +339,7 @@ class ManifestValidationTest : FunSpec({
339
339
340
340
test("enum type with just one allowed value") {
341
341
// given
342
- val manifest = Manifest (
342
+ val manifest = TypesManifest (
343
343
typingSpec = expectedTypingSpec,
344
344
inputs = mapOf(
345
345
"enum-input" to ApiItem (type = "enum", allowedValues = listOf("foo")),
@@ -360,7 +360,7 @@ class ManifestValidationTest : FunSpec({
360
360
361
361
test("list type without 'listItem' attribute") {
362
362
// given
363
- val manifest = Manifest (
363
+ val manifest = TypesManifest (
364
364
typingSpec = expectedTypingSpec,
365
365
inputs = mapOf(
366
366
"list-input" to ApiItem (type = "list", separator = ","),
@@ -381,7 +381,7 @@ class ManifestValidationTest : FunSpec({
381
381
382
382
test("list type without 'separator' attribute") {
383
383
// given
384
- val manifest = Manifest (
384
+ val manifest = TypesManifest (
385
385
typingSpec = expectedTypingSpec,
386
386
inputs = mapOf(
387
387
"list-input" to ApiItem (type = "list", listItem = ApiItem (type = "string")),
@@ -402,7 +402,7 @@ class ManifestValidationTest : FunSpec({
402
402
403
403
test("list type with 'allowedValues' attribute") {
404
404
// given
405
- val manifest = Manifest (
405
+ val manifest = TypesManifest (
406
406
typingSpec = expectedTypingSpec,
407
407
inputs = mapOf(
408
408
"list-input" to ApiItem (
@@ -428,7 +428,7 @@ class ManifestValidationTest : FunSpec({
428
428
429
429
test("list type with forbidden list item type") {
430
430
// given
431
- val manifest = Manifest (
431
+ val manifest = TypesManifest (
432
432
typingSpec = expectedTypingSpec,
433
433
inputs = mapOf(
434
434
"list-of-lists-input" to ApiItem (
@@ -459,7 +459,7 @@ class ManifestValidationTest : FunSpec({
459
459
460
460
test("list type with list item type with incorrect attributes") {
461
461
// given
462
- val manifest = Manifest (
462
+ val manifest = TypesManifest (
463
463
typingSpec = expectedTypingSpec,
464
464
inputs = mapOf(
465
465
"list-of-enums-without-allowed-values-input" to ApiItem (
@@ -502,7 +502,7 @@ class ManifestValidationTest : FunSpec({
502
502
503
503
test("non-integer types with named values") {
504
504
// given
505
- val manifest = Manifest (
505
+ val manifest = TypesManifest (
506
506
typingSpec = expectedTypingSpec,
507
507
inputs = mapOf(
508
508
"string-input" to ApiItem (type = "string", namedValues = mapOf("foo" to 1)),
0 commit comments