Skip to content

Commit 628a7ca

Browse files
committed
Add test cases for string liters | string, which should be string.
1 parent 191e7da commit 628a7ca

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
class MyObject {
22
foo: "ok" | "fail" | "abort";
3+
bar: "ok" | "fail" | "abort" | string;
34
}

test/programs/string-literals-inline/schema.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,14 @@
88
"fail",
99
"ok"
1010
]
11+
},
12+
"bar": {
13+
"type": "string"
1114
}
1215
},
1316
"required": [
14-
"foo"
17+
"foo",
18+
"bar"
1519
],
1620
"$schema": "http://json-schema.org/draft-04/schema#"
1721
}

test/programs/string-literals/main.ts

+1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ type result = "ok" | "fail" | "abort";
22

33
class MyObject {
44
foo: result;
5+
bar: result | string;
56
}

test/programs/string-literals/schema.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@
33
"properties": {
44
"foo": {
55
"$ref": "#/definitions/result"
6+
},
7+
"bar": {
8+
"type": "string"
69
}
710
},
811
"required": [
9-
"foo"
12+
"foo",
13+
"bar"
1014
],
1115
"definitions": {
1216
"result": {

0 commit comments

Comments
 (0)