]>
Commit | Line | Data |
---|---|---|
824a9c6d PK |
1 | import { assert } from 'chai'; |
2 | import * as Terminal from '../xterm'; | |
3 | import * as Clipboard from './Clipboard'; | |
42a1e4ef PK |
4 | |
5 | ||
6 | describe('evaluateCopiedTextProcessing', function () { | |
8b1067d1 DI |
7 | it('should replace non-breaking spaces with regular spaces', () => { |
8 | const nbsp = String.fromCharCode(160); | |
9 | const result = Clipboard.prepareTextForClipboard(`foo${nbsp}bar\ntest${nbsp}${nbsp}`); | |
10 | assert.equal(result, 'foo bar\ntest '); | |
42a1e4ef PK |
11 | }); |
12 | }); | |
0532e5cb JD |
13 | |
14 | describe('evaluatePastedTextProcessing', function () { | |
15 | it('should replace carriage return + line feed with line feed on windows', function () { | |
16 | const pastedText = 'foo\r\nbar\r\n', | |
17 | processedText = Clipboard.prepareTextForTerminal(pastedText, false), | |
18 | windowsProcessedText = Clipboard.prepareTextForTerminal(pastedText, true); | |
19 | ||
20 | assert.equal(processedText, 'foo\r\nbar\r\n'); | |
21 | assert.equal(windowsProcessedText, 'foo\nbar\n'); | |
22 | }); | |
23 | }); |