From c60886de45c2538c0b4d8f949ffc3529938a5223 Mon Sep 17 00:00:00 2001 From: cm-ayf Date: Sat, 11 May 2024 10:14:45 +0900 Subject: [PATCH] add test for template literal patterns --- test/programs/string-template-literal/main.ts | 3 +++ .../string-template-literal/schema.json | 17 ++++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/test/programs/string-template-literal/main.ts b/test/programs/string-template-literal/main.ts index 4b0745b0..adfb457b 100644 --- a/test/programs/string-template-literal/main.ts +++ b/test/programs/string-template-literal/main.ts @@ -8,4 +8,7 @@ interface MyObject { g: `${string}@`, h: `${number}@`, i: `${string}@${number}`, + j: `{{${string}}}` + k: `${string}\n` + l: `${string}-${string}` } \ No newline at end of file diff --git a/test/programs/string-template-literal/schema.json b/test/programs/string-template-literal/schema.json index cc39dd2c..bb0149f8 100644 --- a/test/programs/string-template-literal/schema.json +++ b/test/programs/string-template-literal/schema.json @@ -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, @@ -51,7 +63,10 @@ "f", "g", "h", - "i" + "i", + "j", + "k", + "l" ], "$schema": "http://json-schema.org/draft-07/schema#" } \ No newline at end of file