Skip to content

Commit b9a486a

Browse files
committed
add tests
1 parent e58a65a commit b9a486a

File tree

4 files changed

+53
-0
lines changed

4 files changed

+53
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { test } from '../../test';
2+
3+
export default test({});
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import 'svelte/internal/disclose-version';
2+
import * as $ from 'svelte/internal/client';
3+
4+
var on_click = (_, count) => $.update(count);
5+
var root = $.template(`<h1></h1> <b></b> <button> </button> <h1></h1>`, 1);
6+
7+
export default function Nullish_coallescence_omittance($$anchor) {
8+
let name = 'world';
9+
let count = $.state(0);
10+
var fragment = root();
11+
var h1 = $.first_child(fragment);
12+
13+
h1.textContent = `Hello, ${name ?? ''}!`;
14+
15+
var b = $.sibling(h1, 2);
16+
17+
b.textContent = `${1 ?? 'stuff'}${2 ?? 'more stuff'}${3 ?? 'even more stuff'}`;
18+
19+
var button = $.sibling(b, 2);
20+
21+
button.__click = [on_click, count];
22+
23+
var text = $.child(button);
24+
25+
$.reset(button);
26+
27+
var h1_1 = $.sibling(button, 2);
28+
29+
h1_1.textContent = `Hello, ${name ?? 'earth' ?? ''}`;
30+
$.template_effect(() => $.set_text(text, `Count is ${$.get(count) ?? ''}`));
31+
$.append($$anchor, fragment);
32+
}
33+
34+
$.delegate(['click']);
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import * as $ from 'svelte/internal/server';
2+
3+
export default function Nullish_coallescence_omittance($$payload) {
4+
let name = 'world';
5+
let count = 0;
6+
7+
$$payload.out += `<h1>Hello, ${$.escape(name)}!</h1> <b>${$.escape(1 ?? 'stuff')}${$.escape(2 ?? 'more stuff')}${$.escape(3 ?? 'even more stuff')}</b> <button>Count is ${$.escape(count)}</button> <h1>Hello, ${$.escape(name ?? 'earth' ?? null)}</h1>`;
8+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<script>
2+
let name = 'world';
3+
let count = $state(0);
4+
</script>
5+
<h1>Hello, {null}{name}!</h1>
6+
<b>{1 ?? 'stuff'}{2 ?? 'more stuff'}{3 ?? 'even more stuff'}</b>
7+
<button onclick={()=>count++}>Count is {count}</button>
8+
<h1>Hello, {name ?? 'earth' ?? null}</h1>

0 commit comments

Comments
 (0)