Skip to content

Commit ec3e591

Browse files
committed
Add additional test
1 parent 674d721 commit ec3e591

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/test/suite/lib/textHelpers.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ describe('Text Helpers', () => {
2323
content: 'doSomethingElse() {\n throw new Error(\'Nope!\');\n}',
2424
selection: new Selection(7, 2, 9, 3)
2525
};
26+
const testSelection3: TestSelection = {
27+
content: '}\n\ndoSomethingElse() {',
28+
selection: new Selection(5, 0, 7, 21)
29+
};
2630
let document: TextDocument;
2731

2832
before(async () => {
@@ -61,6 +65,12 @@ describe('Text Helpers', () => {
6165
);
6266
});
6367

68+
it('generates the correct text when selection contains empty line', () => {
69+
assert.deepEqual(testSelection3.content,
70+
generateCopyableText(document, testSelection3.selection)
71+
);
72+
});
73+
6474
context('wrapTextInMarkdownCodeBlock', () => {
6575
it('returns the text wrapped in a Markdown code block', () => {
6676
const codeSnippet = 'console.log("Yo");';

0 commit comments

Comments
 (0)