Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
timmorey committed Oct 4, 2021
1 parent d1bbe3c commit ba2b46a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/ember-auto-import/ts/tests/analyzer-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -487,4 +487,17 @@ Qmodule('analyzer-deserialize', function () {
let result = await deserialize(source([`stuff stuff stuff ${meta.slice(0, -2)}`, meta.slice(-2)]));
assert.deepEqual(result, sampleData());
});

test('false end marker at end of chunk', async function (assert) {
const meta = serialize(sampleData());
assert.ok(
meta.slice(MARKER.length, -MARKER.length).indexOf(MARKER[0]) > -1,
'serialized sample data must contain first character of MARKER somewhere between boundary markers for test to have meaning'
);
const slicePos = meta.slice(MARKER.length, -MARKER.length).indexOf(MARKER[0]) + MARKER.length + 1;
const result = await deserialize(
source([`stuff stuff stuff ${meta.slice(0, slicePos)}`, `${meta.slice(slicePos)} stuff stuff`])
);
assert.deepEqual(result, sampleData());
});
});

0 comments on commit ba2b46a

Please sign in to comment.