Skip to content

Commit e2d7deb

Browse files
committed
Fix test
1 parent 22439cc commit e2d7deb

File tree

2 files changed

+46
-46
lines changed

2 files changed

+46
-46
lines changed

Extension/src/Debugger/nativeAttach.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ export class PsAttachItemsProvider extends NativeAttachItemsProvider {
124124

125125
export class PsProcessParser {
126126
// Use a large fixed width - the default on MacOS is quite small.
127-
private static fixedWidth = ''.padEnd(512, 'a');
127+
static fixedWidth = ''.padEnd(512, 'a');
128128

129129
// Note that comm on Linux systems is truncated to 16 characters:
130130
// https://bugzilla.redhat.com/show_bug.cgi?id=429565

Extension/test/scenarios/SingleRootProject/tests/extension.test.ts

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -12,40 +12,40 @@ import { LinuxDistribution } from '../../../../src/linuxDistribution';
1212
suite("LinuxDistro Tests", () => {
1313
test("Parse valid os-release file", () => {
1414
const dataUbuntu1404: string = 'NAME="Ubuntu"' + os.EOL +
15-
'VERSION="14.04.4 LTS, Trusty Tahr"' + os.EOL +
16-
'ID=ubuntu' + os.EOL +
17-
'ID_LIKE=debian' + os.EOL +
18-
'PRETTY_NAME="Ubuntu 14.04.4 LTS"' + os.EOL +
19-
'VERSION_ID="14.04"' + os.EOL +
20-
'HOME_URL="http://www.ubuntu.com/"' + os.EOL +
21-
'SUPPORT_URL="http://help.ubuntu.com/"' + os.EOL +
22-
'BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"';
15+
'VERSION="14.04.4 LTS, Trusty Tahr"' + os.EOL +
16+
'ID=ubuntu' + os.EOL +
17+
'ID_LIKE=debian' + os.EOL +
18+
'PRETTY_NAME="Ubuntu 14.04.4 LTS"' + os.EOL +
19+
'VERSION_ID="14.04"' + os.EOL +
20+
'HOME_URL="http://www.ubuntu.com/"' + os.EOL +
21+
'SUPPORT_URL="http://help.ubuntu.com/"' + os.EOL +
22+
'BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"';
2323

2424
const dataUbuntu1510: string = 'NAME="Ubuntu"' + os.EOL +
25-
'VERSION="15.10 (Wily Werewolf)"' + os.EOL +
26-
'ID=ubuntu' + os.EOL +
27-
'ID_LIKE=debian' + os.EOL +
28-
'PRETTY_NAME="Ubuntu 15.10"' + os.EOL +
29-
'VERSION_ID="15.10"' + os.EOL +
30-
'HOME_URL="http://www.ubuntu.com/"' + os.EOL +
31-
'SUPPORT_URL="http://help.ubuntu.com/"' + os.EOL +
32-
'BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"';
25+
'VERSION="15.10 (Wily Werewolf)"' + os.EOL +
26+
'ID=ubuntu' + os.EOL +
27+
'ID_LIKE=debian' + os.EOL +
28+
'PRETTY_NAME="Ubuntu 15.10"' + os.EOL +
29+
'VERSION_ID="15.10"' + os.EOL +
30+
'HOME_URL="http://www.ubuntu.com/"' + os.EOL +
31+
'SUPPORT_URL="http://help.ubuntu.com/"' + os.EOL +
32+
'BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"';
3333

3434
const dataCentos73: string = 'NAME="CentOS Linux"' + os.EOL +
35-
'VERSION="7 (Core)"' + os.EOL +
36-
'ID="centos"' + os.EOL +
37-
'ID_LIKE="rhel fedora"' + os.EOL +
38-
'VERSION_ID="7"' + os.EOL +
39-
'PRETTY_NAME="CentOS Linux 7 (Core)"' + os.EOL +
40-
'ANSI_COLOR="0;31"' + os.EOL +
41-
'CPE_NAME="cpe:/o:centos:centos:7"' + os.EOL +
42-
'HOME_URL="https://www.centos.org/"' + os.EOL +
43-
'BUG_REPORT_URL="https://bugs.centos.org/"' + os.EOL +
44-
os.EOL +
45-
'CENTOS_MANTISBT_PROJECT="CentOS-7"' + os.EOL +
46-
'CENTOS_MANTISBT_PROJECT_VERSION="7"' + os.EOL +
47-
'REDHAT_SUPPORT_PRODUCT="centos"' + os.EOL +
48-
'REDHAT_SUPPORT_PRODUCT_VERSION="7"';
35+
'VERSION="7 (Core)"' + os.EOL +
36+
'ID="centos"' + os.EOL +
37+
'ID_LIKE="rhel fedora"' + os.EOL +
38+
'VERSION_ID="7"' + os.EOL +
39+
'PRETTY_NAME="CentOS Linux 7 (Core)"' + os.EOL +
40+
'ANSI_COLOR="0;31"' + os.EOL +
41+
'CPE_NAME="cpe:/o:centos:centos:7"' + os.EOL +
42+
'HOME_URL="https://www.centos.org/"' + os.EOL +
43+
'BUG_REPORT_URL="https://bugs.centos.org/"' + os.EOL +
44+
os.EOL +
45+
'CENTOS_MANTISBT_PROJECT="CentOS-7"' + os.EOL +
46+
'CENTOS_MANTISBT_PROJECT_VERSION="7"' + os.EOL +
47+
'REDHAT_SUPPORT_PRODUCT="centos"' + os.EOL +
48+
'REDHAT_SUPPORT_PRODUCT_VERSION="7"';
4949

5050
const ubuntu1404: LinuxDistribution = LinuxDistribution.getDistroInformation(dataUbuntu1404);
5151
const ubuntu1510: LinuxDistribution = LinuxDistribution.getDistroInformation(dataUbuntu1510);
@@ -74,18 +74,18 @@ suite("Pick Process Tests", () => {
7474
test("Parse valid wmic output", () => {
7575
// output from the command used in WmicAttachItemsProvider
7676
const wmicOutput: string = 'CommandLine=' + os.EOL +
77-
'Name=System Idle Process' + os.EOL +
78-
'ProcessId=0' + os.EOL +
79-
'' + os.EOL +
80-
'' + os.EOL +
81-
'CommandLine="C:\\Program Files (x86)\\Microsoft Office\\root\\Office16\\ONENOTE.EXE"' + os.EOL +
82-
'Name=ONENOTE.EXE' + os.EOL +
83-
'ProcessId=6540' + os.EOL +
84-
'' + os.EOL +
85-
'' + os.EOL +
86-
`CommandLine=\\??\\C:\\windows\\system32\\conhost.exe 0x4` + os.EOL +
87-
'Name=conhost.exe' + os.EOL +
88-
'ProcessId=59148' + os.EOL;
77+
'Name=System Idle Process' + os.EOL +
78+
'ProcessId=0' + os.EOL +
79+
'' + os.EOL +
80+
'' + os.EOL +
81+
'CommandLine="C:\\Program Files (x86)\\Microsoft Office\\root\\Office16\\ONENOTE.EXE"' + os.EOL +
82+
'Name=ONENOTE.EXE' + os.EOL +
83+
'ProcessId=6540' + os.EOL +
84+
'' + os.EOL +
85+
'' + os.EOL +
86+
`CommandLine=\\??\\C:\\windows\\system32\\conhost.exe 0x4` + os.EOL +
87+
'Name=conhost.exe' + os.EOL +
88+
'ProcessId=59148' + os.EOL;
8989

9090
const parsedOutput: Process[] = WmicProcessParser.ParseProcessFromWmic(wmicOutput);
9191

@@ -108,9 +108,9 @@ suite("Pick Process Tests", () => {
108108

109109
test("Parse valid ps output", () => {
110110
// output from the command used in PsAttachItemsProvider
111-
const psOutput: string = ' aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + os.EOL +
112-
'15470 ScopedBookmarkAgent ScopedBookmarkAgent' + os.EOL +
113-
'15220 mdworker mdworker -s mdworker -c MDSImporterWorker -m com.apple.mdworker.shared' + os.EOL;
111+
const psOutput: string = ' ' + PsProcessParser.fixedWidth + os.EOL +
112+
'15470 ' + "ScopedBookmarkAgent".padEnd(512, ' ') + 'ScopedBookmarkAgent' + os.EOL +
113+
'15220 ' + "mdworker".padEnd(512, ' ') + 'mdworker -s mdworker -c MDSImporterWorker -m com.apple.mdworker.shared' + os.EOL;
114114

115115
const parsedOutput: Process[] = PsProcessParser.ParseProcessFromPs(psOutput);
116116

0 commit comments

Comments
 (0)