mirror of https://github.com/sveltejs/svelte
parent
37eee7425f
commit
1579c50327
@ -0,0 +1,11 @@
|
|||||||
|
<Widget bind:potato/>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import Widget from 'wherever';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
Widget
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
@ -0,0 +1,34 @@
|
|||||||
|
export function test ({ assert, smc, locateInSource, locateInGenerated }) {
|
||||||
|
const expected = locateInSource( 'potato' );
|
||||||
|
|
||||||
|
let loc;
|
||||||
|
let actual;
|
||||||
|
|
||||||
|
loc = locateInGenerated( 'potato' );
|
||||||
|
|
||||||
|
actual = smc.originalPositionFor({
|
||||||
|
line: loc.line + 1,
|
||||||
|
column: loc.column
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.deepEqual( actual, {
|
||||||
|
source: 'input.html',
|
||||||
|
name: null,
|
||||||
|
line: expected.line + 1,
|
||||||
|
column: expected.column
|
||||||
|
});
|
||||||
|
|
||||||
|
loc = locateInGenerated( 'potato', loc.character + 1 );
|
||||||
|
|
||||||
|
actual = smc.originalPositionFor({
|
||||||
|
line: loc.line + 1,
|
||||||
|
column: loc.column
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.deepEqual( actual, {
|
||||||
|
source: 'input.html',
|
||||||
|
name: null,
|
||||||
|
line: expected.line + 1,
|
||||||
|
column: expected.column
|
||||||
|
});
|
||||||
|
}
|
@ -0,0 +1 @@
|
|||||||
|
<input bind:value='foo.bar.baz'>
|
@ -0,0 +1,34 @@
|
|||||||
|
export function test ({ assert, smc, locateInSource, locateInGenerated }) {
|
||||||
|
const expected = locateInSource( 'foo.bar.baz' );
|
||||||
|
|
||||||
|
let loc;
|
||||||
|
let actual;
|
||||||
|
|
||||||
|
loc = locateInGenerated( 'foo.bar.baz' );
|
||||||
|
|
||||||
|
actual = smc.originalPositionFor({
|
||||||
|
line: loc.line + 1,
|
||||||
|
column: loc.column
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.deepEqual( actual, {
|
||||||
|
source: 'input.html',
|
||||||
|
name: null,
|
||||||
|
line: expected.line + 1,
|
||||||
|
column: expected.column
|
||||||
|
});
|
||||||
|
|
||||||
|
loc = locateInGenerated( 'foo.bar.baz', loc.character + 1 );
|
||||||
|
|
||||||
|
actual = smc.originalPositionFor({
|
||||||
|
line: loc.line + 1,
|
||||||
|
column: loc.column
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.deepEqual( actual, {
|
||||||
|
source: 'input.html',
|
||||||
|
name: null,
|
||||||
|
line: expected.line + 1,
|
||||||
|
column: expected.column
|
||||||
|
});
|
||||||
|
}
|
Loading…
Reference in new issue