From 7352b2d9021aad1436687051cfd794ca11fbacc1 Mon Sep 17 00:00:00 2001 From: Nguyen Tran Date: Mon, 24 Apr 2023 09:26:40 -0400 Subject: [PATCH] Add tests where variable declarations might not be in a statement array --- .../samples/var-in-do-while-block/_config.js | 7 ++++ .../samples/var-in-do-while-block/main.svelte | 9 +++++ .../var-store-in-do-while-loop/_config.js | 3 ++ .../var-store-in-do-while-loop/main.svelte | 15 +++++++ .../samples/var-store-in-for-loop/_config.js | 3 ++ .../samples/var-store-in-for-loop/main.svelte | 16 ++++++++ .../samples/var-store-in-if/_config.js | 3 ++ .../samples/var-store-in-if/main.svelte | 20 ++++++++++ .../var-store-in-labeled-statement/_config.js | 3 ++ .../main.svelte | 15 +++++++ .../var-store-in-switch-statement/_config.js | 3 ++ .../var-store-in-switch-statement/main.svelte | 39 +++++++++++++++++++ .../var-store-in-while-loop/_config.js | 3 ++ .../var-store-in-while-loop/main.svelte | 16 ++++++++ 14 files changed, 155 insertions(+) create mode 100644 test/runtime/samples/var-in-do-while-block/_config.js create mode 100644 test/runtime/samples/var-in-do-while-block/main.svelte create mode 100644 test/runtime/samples/var-store-in-do-while-loop/_config.js create mode 100644 test/runtime/samples/var-store-in-do-while-loop/main.svelte create mode 100644 test/runtime/samples/var-store-in-for-loop/_config.js create mode 100644 test/runtime/samples/var-store-in-for-loop/main.svelte create mode 100644 test/runtime/samples/var-store-in-if/_config.js create mode 100644 test/runtime/samples/var-store-in-if/main.svelte create mode 100644 test/runtime/samples/var-store-in-labeled-statement/_config.js create mode 100644 test/runtime/samples/var-store-in-labeled-statement/main.svelte create mode 100644 test/runtime/samples/var-store-in-switch-statement/_config.js create mode 100644 test/runtime/samples/var-store-in-switch-statement/main.svelte create mode 100644 test/runtime/samples/var-store-in-while-loop/_config.js create mode 100644 test/runtime/samples/var-store-in-while-loop/main.svelte diff --git a/test/runtime/samples/var-in-do-while-block/_config.js b/test/runtime/samples/var-in-do-while-block/_config.js new file mode 100644 index 0000000000..1ba2c535ec --- /dev/null +++ b/test/runtime/samples/var-in-do-while-block/_config.js @@ -0,0 +1,7 @@ +export default { + props: { + a: 13 + }, + + html: '

169

' +}; diff --git a/test/runtime/samples/var-in-do-while-block/main.svelte b/test/runtime/samples/var-in-do-while-block/main.svelte new file mode 100644 index 0000000000..cb4d4ff93e --- /dev/null +++ b/test/runtime/samples/var-in-do-while-block/main.svelte @@ -0,0 +1,9 @@ + + +

{b}

diff --git a/test/runtime/samples/var-store-in-do-while-loop/_config.js b/test/runtime/samples/var-store-in-do-while-loop/_config.js new file mode 100644 index 0000000000..59ee78d297 --- /dev/null +++ b/test/runtime/samples/var-store-in-do-while-loop/_config.js @@ -0,0 +1,3 @@ +export default { + html: '

3

5

' +}; diff --git a/test/runtime/samples/var-store-in-do-while-loop/main.svelte b/test/runtime/samples/var-store-in-do-while-loop/main.svelte new file mode 100644 index 0000000000..22eb676fc1 --- /dev/null +++ b/test/runtime/samples/var-store-in-do-while-loop/main.svelte @@ -0,0 +1,15 @@ + + +

{x}

+

{y}

diff --git a/test/runtime/samples/var-store-in-for-loop/_config.js b/test/runtime/samples/var-store-in-for-loop/_config.js new file mode 100644 index 0000000000..59ee78d297 --- /dev/null +++ b/test/runtime/samples/var-store-in-for-loop/_config.js @@ -0,0 +1,3 @@ +export default { + html: '

3

5

' +}; diff --git a/test/runtime/samples/var-store-in-for-loop/main.svelte b/test/runtime/samples/var-store-in-for-loop/main.svelte new file mode 100644 index 0000000000..21b8beed20 --- /dev/null +++ b/test/runtime/samples/var-store-in-for-loop/main.svelte @@ -0,0 +1,16 @@ + + +

{x}

+

{y}

diff --git a/test/runtime/samples/var-store-in-if/_config.js b/test/runtime/samples/var-store-in-if/_config.js new file mode 100644 index 0000000000..59ee78d297 --- /dev/null +++ b/test/runtime/samples/var-store-in-if/_config.js @@ -0,0 +1,3 @@ +export default { + html: '

3

5

' +}; diff --git a/test/runtime/samples/var-store-in-if/main.svelte b/test/runtime/samples/var-store-in-if/main.svelte new file mode 100644 index 0000000000..e652968a79 --- /dev/null +++ b/test/runtime/samples/var-store-in-if/main.svelte @@ -0,0 +1,20 @@ + + +

{x}

+

{y}

diff --git a/test/runtime/samples/var-store-in-labeled-statement/_config.js b/test/runtime/samples/var-store-in-labeled-statement/_config.js new file mode 100644 index 0000000000..59ee78d297 --- /dev/null +++ b/test/runtime/samples/var-store-in-labeled-statement/_config.js @@ -0,0 +1,3 @@ +export default { + html: '

3

5

' +}; diff --git a/test/runtime/samples/var-store-in-labeled-statement/main.svelte b/test/runtime/samples/var-store-in-labeled-statement/main.svelte new file mode 100644 index 0000000000..1e28bea21d --- /dev/null +++ b/test/runtime/samples/var-store-in-labeled-statement/main.svelte @@ -0,0 +1,15 @@ + + +

{x}

+

{y}

diff --git a/test/runtime/samples/var-store-in-switch-statement/_config.js b/test/runtime/samples/var-store-in-switch-statement/_config.js new file mode 100644 index 0000000000..59ee78d297 --- /dev/null +++ b/test/runtime/samples/var-store-in-switch-statement/_config.js @@ -0,0 +1,3 @@ +export default { + html: '

3

5

' +}; diff --git a/test/runtime/samples/var-store-in-switch-statement/main.svelte b/test/runtime/samples/var-store-in-switch-statement/main.svelte new file mode 100644 index 0000000000..951b118fc7 --- /dev/null +++ b/test/runtime/samples/var-store-in-switch-statement/main.svelte @@ -0,0 +1,39 @@ + + +

{x}

+

{y}

diff --git a/test/runtime/samples/var-store-in-while-loop/_config.js b/test/runtime/samples/var-store-in-while-loop/_config.js new file mode 100644 index 0000000000..59ee78d297 --- /dev/null +++ b/test/runtime/samples/var-store-in-while-loop/_config.js @@ -0,0 +1,3 @@ +export default { + html: '

3

5

' +}; diff --git a/test/runtime/samples/var-store-in-while-loop/main.svelte b/test/runtime/samples/var-store-in-while-loop/main.svelte new file mode 100644 index 0000000000..9621d4c684 --- /dev/null +++ b/test/runtime/samples/var-store-in-while-loop/main.svelte @@ -0,0 +1,16 @@ + + +

{x}

+

{y}