From e5a6e4e3053fce5b89a1fe314cb98184df1a4e41 Mon Sep 17 00:00:00 2001 From: pmurray73 Date: Tue, 26 Jan 2021 20:17:50 -0500 Subject: [PATCH] style-directives: more parser tests --- .../input.svelte | 1 + .../output.json | 31 ++++++++++++++++++ .../input.svelte | 1 + .../output.json | 32 +++++++++++++++++++ 4 files changed, 65 insertions(+) create mode 100644 test/parser/samples/attribute-style-directive-shorthand.solo/input.svelte create mode 100644 test/parser/samples/attribute-style-directive-shorthand.solo/output.json create mode 100644 test/parser/samples/attribute-style-directive-string.solo/input.svelte create mode 100644 test/parser/samples/attribute-style-directive-string.solo/output.json diff --git a/test/parser/samples/attribute-style-directive-shorthand.solo/input.svelte b/test/parser/samples/attribute-style-directive-shorthand.solo/input.svelte new file mode 100644 index 0000000000..3e2c66f218 --- /dev/null +++ b/test/parser/samples/attribute-style-directive-shorthand.solo/input.svelte @@ -0,0 +1 @@ +
\ No newline at end of file diff --git a/test/parser/samples/attribute-style-directive-shorthand.solo/output.json b/test/parser/samples/attribute-style-directive-shorthand.solo/output.json new file mode 100644 index 0000000000..d4e81b6e4b --- /dev/null +++ b/test/parser/samples/attribute-style-directive-shorthand.solo/output.json @@ -0,0 +1,31 @@ +{ + "html": { + "start": 0, + "end": 23, + "type": "Fragment", + "children": [ + { + "start": 0, + "end": 23, + "type": "Element", + "name": "div", + "attributes": [ + { + "start": 5, + "end": 16, + "type": "Style", + "name": "color", + "modifiers": [], + "expression": { + "start": 11, + "end": 16, + "name": "color", + "type": "Identifier" + } + } + ], + "children": [] + } + ] + } +} diff --git a/test/parser/samples/attribute-style-directive-string.solo/input.svelte b/test/parser/samples/attribute-style-directive-string.solo/input.svelte new file mode 100644 index 0000000000..b2eb6bfef8 --- /dev/null +++ b/test/parser/samples/attribute-style-directive-string.solo/input.svelte @@ -0,0 +1 @@ +
\ No newline at end of file diff --git a/test/parser/samples/attribute-style-directive-string.solo/output.json b/test/parser/samples/attribute-style-directive-string.solo/output.json new file mode 100644 index 0000000000..2e5e678e93 --- /dev/null +++ b/test/parser/samples/attribute-style-directive-string.solo/output.json @@ -0,0 +1,32 @@ +{ + "html": { + "start": 0, + "end": 29, + "type": "Fragment", + "children": [ + { + "start": 0, + "end": 29, + "type": "Element", + "name": "div", + "attributes": [ + { + "start": 5, + "end": 22, + "type": "Style", + "name": "color", + "modifiers": [], + "expression": { + "end": 22, + "name": "color", + "start": 11, + "type": "Identifier" + }, + "text": "red" + } + ], + "children": [] + } + ] + } +}