Skip to content

Commit a4978d5

Browse files
award999michael-weng
authored andcommitted
Some depedency view test fixes
1 parent 133ccee commit a4978d5

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

test/integration-tests/ui/PackageDependencyProvider.test.ts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
//===----------------------------------------------------------------------===//
1414

1515
import { expect } from "chai";
16+
import * as path from "path";
1617
import {
1718
PackageDependenciesProvider,
1819
PackageNode,
@@ -51,7 +52,7 @@ suite("PackageDependencyProvider Test Suite", function () {
5152
expect(dep).to.not.be.undefined;
5253
expect(dep?.location).to.equal("https://github.com/swiftlang/swift-markdown.git");
5354
expect(dep?.path).to.equal(
54-
`${testAssetPath("dependencies")}/.build/checkouts/swift-markdown`
55+
path.join(testAssetPath("dependencies"), ".build/checkouts/swift-markdown")
5556
);
5657
});
5758

@@ -74,20 +75,22 @@ suite("PackageDependencyProvider Test Suite", function () {
7475
const folder = folders.find(n => n.name === "Sources");
7576
expect(folder).to.not.be.undefined;
7677

77-
expect(folder?.path).to.equal(`${testAssetPath("defaultPackage")}/Sources`);
78+
expect(folder?.path).to.equal(path.join(testAssetPath("defaultPackage"), "Sources"));
7879

7980
const childFolders = await treeProvider.getChildren(folder);
8081
const childFolder = childFolders.find(n => n.name === "PackageExe");
8182
expect(childFolder).to.not.be.undefined;
8283

83-
expect(childFolder?.path).to.equal(`${testAssetPath("defaultPackage")}/Sources/PackageExe`);
84+
expect(childFolder?.path).to.equal(
85+
path.join(testAssetPath("defaultPackage"), "Sources/PackageExe")
86+
);
8487

8588
const files = await treeProvider.getChildren(childFolder);
8689
const file = files.find(n => n.name === "main.swift");
8790
expect(file).to.not.be.undefined;
8891

8992
expect(file?.path).to.equal(
90-
`${testAssetPath("defaultPackage")}/Sources/PackageExe/main.swift`
93+
path.join(testAssetPath("defaultPackage"), "Sources/PackageExe/main.swift")
9194
);
9295
});
9396

@@ -101,19 +104,19 @@ suite("PackageDependencyProvider Test Suite", function () {
101104
const folder = folders.find(n => n.name === "Sources");
102105
expect(folder).to.not.be.undefined;
103106

104-
const path = `${testAssetPath("dependencies")}/.build/checkouts/swift-markdown`;
105-
expect(folder?.path).to.equal(`${path}/Sources`);
107+
const depPath = path.join(testAssetPath("dependencies"), ".build/checkouts/swift-markdown");
108+
expect(folder?.path).to.equal(path.join(depPath, "Sources"));
106109

107110
const childFolders = await treeProvider.getChildren(folder);
108111
const childFolder = childFolders.find(n => n.name === "CAtomic");
109112
expect(childFolder).to.not.be.undefined;
110113

111-
expect(childFolder?.path).to.equal(`${path}/Sources/CAtomic`);
114+
expect(childFolder?.path).to.equal(path.join(depPath, "Sources/CAtomic"));
112115

113116
const files = await treeProvider.getChildren(childFolder);
114117
const file = files.find(n => n.name === "CAtomic.c");
115118
expect(file).to.not.be.undefined;
116119

117-
expect(file?.path).to.equal(`${path}/Sources/CAtomic/CAtomic.c`);
120+
expect(file?.path).to.equal(path.join(depPath, "Sources/CAtomic/CAtomic.c"));
118121
});
119122
});

0 commit comments

Comments
 (0)