]> git.proxmox.com Git - mirror_xterm.js.git/blob - src/handlers/Clipboard.test.ts
Migrate Clipboard handler to TypeScript
[mirror_xterm.js.git] / src / handlers / Clipboard.test.ts
1 import { assert } from 'chai';
2 import * as Terminal from '../xterm';
3 import * as Clipboard from './Clipboard';
4
5
6 describe('evaluateCopiedTextProcessing', function () {
7 it('should strip trailing whitespaces and replace nbsps with spaces', function () {
8 var nonBreakingSpace = String.fromCharCode(160),
9 copiedText = 'echo' + nonBreakingSpace + 'hello' + nonBreakingSpace,
10 processedText = Clipboard.prepareTextForClipboard(copiedText);
11
12 // No trailing spaces
13 assert.equal(processedText.match(/\s+$/), null);
14
15 // No non-breaking space
16 assert.equal(processedText.indexOf(nonBreakingSpace), -1);
17 });
18 });