Skip to content

Commit

Permalink
Additional string detection tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
kitschpatrol committed Dec 8, 2024
1 parent 1da66f3 commit 63e79a7
Showing 1 changed file with 48 additions and 41 deletions.
89 changes: 48 additions & 41 deletions src/examples/tests/TestTextStringDetection.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,46 +5,53 @@
// Related:
// https://github.com/kitschpatrol/svelte-tweakpane-ui/issues/17
import { Text } from '$lib';
let sample01 = 'Hi';
let sample02 = '1';
let sample03 = '0x13';
let sample04 = '0x1337';
let sample05 = '0xEE1337';
let sample06 = '0x1337AA';
let sample07 = '0x1337AA13';
let sample08 = '#13';
let sample09 = '#1337';
let sample10 = '#EE1337';
let sample11 = '#1337AA';
let sample12 = '#1337AA13';
let sample13 = '238, 19, 55';
let sample14 = '238, 19, 55, 0.5';
let sample15 = 'rgb(238, 19, 55)';
let sample16 = 'rgba(238, 19, 55, 0.5)';
let sample17 = 'True';
let sample18 = 'true';
let sample19 = 'False';
let sample20 = 'false';
import { AutoObject, AutoValue, Color, Text } from '$lib';
let strings: Record<string, string> = {
sample01: 'Hi',
sample02: '1',
sample03: '0x13',
sample04: '0x1337',
sample05: '0xEE1337',
sample06: '0x1337AA',
sample07: '0x1337AA13',
sample08: '#13',
sample09: '#1337',
sample10: '#EE1337',
sample11: '#1337AA',
sample12: '#1337AA13',
sample13: '238, 19, 55',
sample14: '238, 19, 55, 0.5',
sample15: 'rgb(238, 19, 55)',
sample16: 'rgba(238, 19, 55, 0.5)',
sample17: 'hsl(238, 19, 55)',
sample18: 'hsla(238, 19, 55, 0.5)',
sample19: 'hsv(238, 19, 55)',
sample20: 'hsva(238, 19, 55, 0.5)',
sample21: 'True',
sample22: 'true',
sample23: 'False',
sample24: 'false',
sample25: 'red'
};
</script>

<Text bind:value={sample01} />
<Text bind:value={sample02} />
<Text bind:value={sample03} />
<Text bind:value={sample04} />
<Text bind:value={sample05} />
<Text bind:value={sample06} />
<Text bind:value={sample07} />
<Text bind:value={sample08} />
<Text bind:value={sample09} />
<Text bind:value={sample10} />
<Text bind:value={sample11} />
<Text bind:value={sample12} />
<Text bind:value={sample13} />
<Text bind:value={sample14} />
<Text bind:value={sample15} />
<Text bind:value={sample16} />
<Text bind:value={sample17} />
<Text bind:value={sample18} />
<Text bind:value={sample19} />
<Text bind:value={sample20} />
<hr />
<h1>Text Component</h1>
{#each Object.keys(strings) as key}
<Text bind:value={strings[key]} label={key} />
{/each}
<hr />
<h1>Auto Value</h1>
{#each Object.keys(strings) as key}
<AutoValue bind:value={strings[key]} label={key} />
{/each}

<hr />
<h1>Auto Object</h1>
<AutoObject bind:object={strings} />
<hr />
<h1>Color Component</h1>
{#each Object.keys(strings) as key}
<Color bind:value={strings[key]} label={key} />
{/each}

0 comments on commit 63e79a7

Please sign in to comment.