Skip to content

Commit 8850b7a

Browse files
committed
Merge pull request #2 from juliangrosshauser/fix-indentation
Fix indentation and remove trailing whitespace of test files
2 parents 14f47ad + 82e993e commit 8850b7a

13 files changed

+75
-75
lines changed

Tests/PackageDescription/PackageDescriptionTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class PackageTests: XCTestCase, XCTestCaseProvider {
2828
("testBasics", testBasics),
2929
]
3030
}
31-
31+
3232
func testBasics() {
3333
// Verify that we can round trip a basic package through TOML.
3434
let p1 = Package(name: "a", dependencies: [.Package(url: "https://example.com/example", majorVersion: 1)])

Tests/dep/DependencyGraphTests.swift

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@ class VersionGraphTests: XCTestCase {
1919
("testNoGraph", testNoGraph),
2020
("testOneDependency", testOneDependency),
2121
("testOneDepenencyWithMultipleAvailableVersions", testOneDepenencyWithMultipleAvailableVersions),
22-
("testOneDepenencyWithMultipleAvailableVersions", testOneDepenencyWithMultipleAvailableVersions),
23-
("testTwoDependencies", testTwoDependencies),
24-
("testTwoDirectDependencies", testTwoDirectDependencies),
25-
("testTwoDirectDependenciesWhereOneAlsoDependsOnTheOther", testTwoDirectDependenciesWhereOneAlsoDependsOnTheOther),
26-
("testSimpleVersionRestrictedGraph", testSimpleVersionRestrictedGraph),
27-
("testComplexVersionRestrictedGraph", testComplexVersionRestrictedGraph),
28-
("testVersionConstrain", testVersionConstrain),
29-
("testTwoDependenciesRequireMutuallyExclusiveVersionsOfTheSameDependency_Simple", testTwoDependenciesRequireMutuallyExclusiveVersionsOfTheSameDependency_Simple),
30-
("testTwoDependenciesRequireMutuallyExclusiveVersionsOfTheSameDependency_Complex", testTwoDependenciesRequireMutuallyExclusiveVersionsOfTheSameDependency_Complex),
31-
("testVersionUnavailable", testVersionUnavailable)
22+
("testOneDepenencyWithMultipleAvailableVersions", testOneDepenencyWithMultipleAvailableVersions),
23+
("testTwoDependencies", testTwoDependencies),
24+
("testTwoDirectDependencies", testTwoDirectDependencies),
25+
("testTwoDirectDependenciesWhereOneAlsoDependsOnTheOther", testTwoDirectDependenciesWhereOneAlsoDependsOnTheOther),
26+
("testSimpleVersionRestrictedGraph", testSimpleVersionRestrictedGraph),
27+
("testComplexVersionRestrictedGraph", testComplexVersionRestrictedGraph),
28+
("testVersionConstrain", testVersionConstrain),
29+
("testTwoDependenciesRequireMutuallyExclusiveVersionsOfTheSameDependency_Simple", testTwoDependenciesRequireMutuallyExclusiveVersionsOfTheSameDependency_Simple),
30+
("testTwoDependenciesRequireMutuallyExclusiveVersionsOfTheSameDependency_Complex", testTwoDependenciesRequireMutuallyExclusiveVersionsOfTheSameDependency_Complex),
31+
("testVersionUnavailable", testVersionUnavailable)
3232
]
3333
}
34-
34+
3535
func testNoGraph() {
3636
class MockFetcher: _MockFetcher {
3737
override func fetch(url url: String) throws -> Fetchable {
@@ -332,10 +332,10 @@ private let v199 = Version(1,9,9)
332332

333333
private enum MockProject: String {
334334
case A
335-
case B
336-
case C
337-
case D
338-
case E
335+
case B
336+
case C
337+
case D
338+
case E
339339
case F
340340
var url: String { return rawValue }
341341
}

Tests/dep/FunctionalBuildTests.swift

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class FunctionalBuildTests: XCTestCase, XCTestCaseProvider {
6565
XCTAssertNotNil(try? executeSwiftBuild(prefix))
6666
}
6767
}
68-
68+
6969
func verifyFilesExist(files: [String], fixturePath: String) -> Bool {
7070
for file in files {
7171
let name = fixturePath.characters.split("/").map(String.init).last!
@@ -80,23 +80,23 @@ class FunctionalBuildTests: XCTestCase, XCTestCaseProvider {
8080
default:
8181
filePath = Path.join(fixturePath, ".build/debug", file)
8282
}
83-
83+
8484
guard filePath.isFile else { return false }
8585
}
8686
return true
8787
}
88-
88+
8989
func testIgnoreFiles() {
9090
fixture(name: "20_ignore_files") { prefix in
9191
XCTAssertNotNil(try? executeSwiftBuild(prefix))
92-
92+
9393
let targets = try! determineTargets(packageName: "foo", prefix: prefix)
94-
94+
9595
XCTAssertEqual(targets.count, 1)
9696
XCTAssertEqual(targets[0].sources.map({ $0.basename }), ["Foo.swift"])
9797
}
9898
}
99-
99+
100100
// 2: Package with one library target
101101
func testSingleLibTarget() {
102102
let filesToVerify = ["rootLib"]
@@ -105,8 +105,8 @@ class FunctionalBuildTests: XCTestCase, XCTestCaseProvider {
105105
XCTAssertTrue(self.verifyFilesExist(filesToVerify, fixturePath: prefix))
106106
}
107107
}
108-
109-
108+
109+
110110
// 3: Package with multiple library targets
111111
func testMultipleLibTargets() {
112112
let filesToVerify = ["BarLib.a", "FooBarLib.a", "FooLib.a"]
@@ -115,8 +115,8 @@ class FunctionalBuildTests: XCTestCase, XCTestCaseProvider {
115115
XCTAssertTrue(self.verifyFilesExist(filesToVerify, fixturePath: prefix))
116116
}
117117
}
118-
119-
118+
119+
120120
// 4: Package with one executable target
121121
func testSingleExecTarget() {
122122
let filesToVerify = ["rootExec"]
@@ -125,7 +125,7 @@ class FunctionalBuildTests: XCTestCase, XCTestCaseProvider {
125125
XCTAssertTrue(self.verifyFilesExist(filesToVerify, fixturePath: prefix))
126126
}
127127
}
128-
128+
129129
// 5: Package with multiple exectuble targets
130130
func testMultipleExecTargets() {
131131
let filesToVerify = ["BarExec", "FooBarExec", "FooExec"]
@@ -152,7 +152,7 @@ class FunctionalBuildTests: XCTestCase, XCTestCaseProvider {
152152
XCTAssertTrue(self.verifyFilesExist(filesToVerify, fixturePath: prefix))
153153
}
154154
}
155-
155+
156156
// 8: Package with multiple library targets in a sources directory
157157
func testMultipleLibTargetsInSources() {
158158
let filesToVerify = ["BarLib.a", "FooBarLib.a", "FooLib.a"]
@@ -161,7 +161,7 @@ class FunctionalBuildTests: XCTestCase, XCTestCaseProvider {
161161
XCTAssertTrue(self.verifyFilesExist(filesToVerify, fixturePath: prefix))
162162
}
163163
}
164-
164+
165165
// 9: Package with a single executable target in a sources directory
166166
func testSingleExecTargetInSources() {
167167
let filesToVerify = ["rootExec"]
@@ -170,7 +170,7 @@ class FunctionalBuildTests: XCTestCase, XCTestCaseProvider {
170170
XCTAssertTrue(self.verifyFilesExist(filesToVerify, fixturePath: prefix))
171171
}
172172
}
173-
173+
174174
// 10: Package with multiple executable targets in a sources directory
175175
func testMultipleExecTargetsInSources() {
176176
let filesToVerify = ["BarExec", "FooBarExec", "FooExec"]
@@ -188,7 +188,7 @@ class FunctionalBuildTests: XCTestCase, XCTestCaseProvider {
188188
XCTAssertTrue(self.verifyFilesExist(filesToVerify, fixturePath: prefix))
189189
}
190190
}
191-
191+
192192
// 12: Package with a single library targets in a src directory
193193
func testSingleLibTargetSrc() {
194194
let filesToVerify = ["rootLib"]
@@ -238,8 +238,8 @@ class FunctionalBuildTests: XCTestCase, XCTestCaseProvider {
238238
}
239239
}
240240
}
241-
242-
241+
242+
243243
// 17: Package with multiple library targets in a sources and src directory
244244
func testMultipleLibTargetsSourcesSrc() {
245245
fixture(name: "17_buildlib_src_sources") { prefix in
@@ -253,8 +253,8 @@ class FunctionalBuildTests: XCTestCase, XCTestCaseProvider {
253253
}
254254
}
255255
}
256-
257-
256+
257+
258258
// 18: Package with multiple executable and library targets in a sources and src directory
259259
func testMultipleLibExecTargetsSourcesSrc() {
260260
fixture(name: "18_buildlibexec_src_sources") { prefix in
@@ -268,8 +268,8 @@ class FunctionalBuildTests: XCTestCase, XCTestCaseProvider {
268268
}
269269
}
270270
}
271-
272-
271+
272+
273273
// 19: Package with multiple executable and library targets in a sources and src directory, and externally
274274
func testMultipleLibExecTargetsSourcesSrcExt() {
275275
fixture(name: "19_buildlibexec_src_sources_external") { prefix in
@@ -283,8 +283,8 @@ class FunctionalBuildTests: XCTestCase, XCTestCaseProvider {
283283
}
284284
}
285285
}
286-
287-
286+
287+
288288
// 20: Single dependency where BarLib depends on FooLib
289289
func testLibDep() {
290290
let filesToVerify = ["BarLib.a", "FooLib.a"]

Tests/dep/ManifestTests.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class ManifestTests: XCTestCase, XCTestCaseProvider {
2121
("testManifestLoading", testManifestLoading),
2222
]
2323
}
24-
24+
2525
private func loadManifest(inputName: String) -> Manifest {
2626
let input = Path.join(__FILE__, "../Inputs", inputName).normpath
2727
do {
@@ -30,20 +30,20 @@ class ManifestTests: XCTestCase, XCTestCaseProvider {
3030
fatalError("unexpected error: \(err)")
3131
}
3232
}
33-
33+
3434
func testManifestLoading() {
3535
// Check a trivial manifest.
3636
var manifest = loadManifest("trivial-manifest")
3737
XCTAssertEqual(manifest.package.name, "Trivial")
3838
XCTAssertEqual(manifest.package.targets, [])
3939
XCTAssertEqual(manifest.package.dependencies, [])
40-
40+
4141
// Check a manifest with package specifications.
4242
manifest = loadManifest("package-deps-manifest")
4343
XCTAssertEqual(manifest.package.name, "PackageDeps")
4444
XCTAssertEqual(manifest.package.targets, [])
4545
XCTAssertEqual(manifest.package.dependencies, [Package.Dependency.Package(url: "https://example.com/example", majorVersion: 1)])
46-
46+
4747
// Check a manifest with targets.
4848
manifest = loadManifest("target-deps-manifest")
4949
XCTAssertEqual(manifest.package.name, "TargetDeps")

Tests/dep/PackageTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ import XCTest
1212
@testable import dep
1313

1414
class PackageTests: XCTestCase {
15-
15+
1616
var allTests : [(String, () -> ())] {
1717
return []
1818
}
19-
19+
2020
func testInitializer() {
2121
do {
2222
// valid path, but no manifest so check throw is correct

Tests/dep/TargetTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class TargetTests: XCTestCase, XCTestCaseProvider {
4040
("test6", test6),
4141
]
4242
}
43-
43+
4444
func test1() {
4545
let t1 = try! Target(name: "t1", files: [], type: .Library)
4646
let t2 = try! Target(name: "t2", files: [], type: .Library)

Tests/dep/Utilities.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func fixture(name fixtureName: String, tag: String = "1.2.3", @noescape body: (S
4646
}
4747
var stream = TempStream()
4848
print(error, toStream: &stream)
49-
49+
5050
XCTFail("\(stream.result)")
5151
}
5252
}

Tests/dep/VersionTests.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,22 @@ class VersionTests: XCTestCase, XCTestCaseProvider {
2626
("testRange", testRange),
2727
]
2828
}
29-
29+
3030
func testEquality() {
3131
func test(@autoclosure v: () -> Version) {
3232
XCTAssertEqual(v(), v())
3333
}
34-
34+
3535
test(Version(1,2,3))
3636
test(Version(0,0,0))
3737
test(Version(Int.min, Int.min, Int.min))
3838
test(Version(Int.max, Int.max, Int.max))
3939
}
40-
40+
4141
func testNegativeValuesBecomeZero() {
4242
XCTAssertEqual(Version(-1, -2, -3), Version(0,0,0))
4343
}
44-
44+
4545
func testComparable() {
4646
do {
4747
let v1 = Version(1,2,3)
@@ -104,19 +104,19 @@ class VersionTests: XCTestCase, XCTestCaseProvider {
104104
XCTAssertGreaterThanOrEqual(v8, v8)
105105
}
106106
}
107-
107+
108108
func testDescription() {
109109
XCTAssertEqual(Version(123,234,345).description, "123.234.345")
110110
}
111-
111+
112112
func testFromString() {
113113
XCTAssertNil(Version(""))
114114
XCTAssertNil(Version("1"))
115115
XCTAssertNil(Version("1.2"))
116116
XCTAssertEqual(Version(1,2,3), Version("1.2.3"))
117117
XCTAssertNil(Version("1.2.3.4"))
118118
XCTAssertNil(Version("1.2.3.4.5"))
119-
119+
120120
XCTAssertNil(Version("a"))
121121
XCTAssertNil(Version("1.a"))
122122
XCTAssertNil(Version("a.2"))

Tests/sys/PathTests.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class PathTests: XCTestCase {
1616

1717
var allTests : [(String, () -> ())] {
1818
return [
19-
("test", test),
19+
("test", test),
2020
("testPrecombined", testPrecombined),
2121
("testExtraSeparators", testExtraSeparators),
2222
("testEmpties", testEmpties),
@@ -93,11 +93,11 @@ class WalkTests: XCTestCase {
9393

9494
var allTests : [(String, () -> ())] {
9595
return [
96-
("testNonRecursive", testNonRecursive),
96+
("testNonRecursive", testNonRecursive),
9797
("testRecursive", testRecursive),
9898
]
99-
}
100-
99+
}
100+
101101
func testNonRecursive() {
102102
var expected = ["/usr", "/bin", "/sbin"]
103103

@@ -132,13 +132,13 @@ class StatTests: XCTestCase {
132132

133133
var allTests : [(String, () -> ())] {
134134
return [
135-
("test_isdir", test_isdir),
135+
("test_isdir", test_isdir),
136136
("test_isfile", test_isfile),
137137
("test_realpath", test_realpath),
138138
("test_basename", test_basename),
139139
]
140-
}
141-
140+
}
141+
142142
func test_isdir() {
143143
XCTAssertTrue("/usr".isDirectory)
144144
XCTAssertTrue("/etc/passwd".isFile)
@@ -166,12 +166,12 @@ class RelativePathTests: XCTestCase {
166166

167167
var allTests : [(String, () -> ())] {
168168
return [
169-
("testAbsolute", testAbsolute),
169+
("testAbsolute", testAbsolute),
170170
("testRelative", testRelative),
171171
("testMixed", testMixed),
172172
]
173-
}
174-
173+
}
174+
175175
func testAbsolute() {
176176
XCTAssertEqual("2/3", Path("/1/2/3").relative(to: "/1/"))
177177
XCTAssertEqual("3/4", Path("/1/2////3/4///").relative(to: "////1//2//"))

Tests/sys/ResourcesTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class ResourcesTests: XCTestCase, XCTestCaseProvider {
2020
("testResources", testResources),
2121
]
2222
}
23-
23+
2424
func testResources() {
2525
// Cause resources to be initialized, even though the path won't actually be correct.
2626
Resources.initialize(&globalSymbolInNonMainBinary)

Tests/sys/ShellTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ class ShellTests: XCTestCase, XCTestCaseProvider {
2020
("testPopenWithBufferLargerThanThatAllocated", testPopenWithBufferLargerThanThatAllocated)
2121
]
2222
}
23-
23+
2424
func testPopen() {
2525
XCTAssertEqual(try! popen(["echo", "foo"]), "foo\n")
2626
}
27-
27+
2828
func testPopenWithBufferLargerThanThatAllocated() {
2929
let path = Path.join(__FILE__, "../../dep/FunctionalBuildTests.swift").normpath
3030
XCTAssertGreaterThan(try! popen(["cat", path]).characters.count, 4096)

0 commit comments

Comments
 (0)