forked from microsoft/vscode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathargv.test.ts
More file actions
41 lines (37 loc) · 1.18 KB
/
argv.test.ts
File metadata and controls
41 lines (37 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import assert = require('assert');
import { formatOptions } from 'vs/platform/environment/node/argv';
suite('formatOptions', () => {
test('Text should display small columns correctly', () => {
assert.equal(formatOptions({ 'foo': 'bar' }, 80), ' foo bar');
assert.equal(
formatOptions({
'f': 'bar',
'fo': 'ba',
'foo': 'b'
}, 80),
' f bar\n' +
' fo ba\n' +
' foo b');
});
test('Text should wrap', () => {
assert.equal(
formatOptions({
'foo': (<any>'bar ').repeat(9)
}, 40),
' foo bar bar bar bar bar bar bar bar\n' +
' bar');
});
test('Text should revert to the condensed view when the terminal is too narrow', () => {
assert.equal(
formatOptions({
'foo': (<any>'bar ').repeat(9)
}, 30),
' foo\n' +
' bar bar bar bar bar bar bar bar bar ');
});
});