Skip to content

Commit

Permalink
add test for template literal patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
cm-ayf committed May 11, 2024
1 parent 31fb449 commit c60886d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
3 changes: 3 additions & 0 deletions test/programs/string-template-literal/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@ interface MyObject {
g: `${string}@`,
h: `${number}@`,
i: `${string}@${number}`,
j: `{{${string}}}`
k: `${string}\n`
l: `${string}-${string}`
}
17 changes: 16 additions & 1 deletion test/programs/string-template-literal/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,18 @@
"i": {
"type": "string",
"pattern": "^.*@[0-9]*$"
},
"j": {
"pattern": "^\\{\\{.*\\}\\}$",
"type": "string"
},
"k": {
"pattern": "^.*\\n$",
"type": "string"
},
"l": {
"pattern": "^.*-.*$",
"type": "string"
}
},
"additionalProperties": false,
Expand All @@ -51,7 +63,10 @@
"f",
"g",
"h",
"i"
"i",
"j",
"k",
"l"
],
"$schema": "http://json-schema.org/draft-07/schema#"
}

0 comments on commit c60886d

Please sign in to comment.