Commit db6e885c authored by Drew's avatar Drew

More Swift 3 first parameter renaming

parent 57c9722c
Pipeline #1524 failed with stage
......@@ -19,7 +19,7 @@ import Foundation
extension String : ErrorProtocol {}
enum test {
static func assert(condition: Bool, file: String = #file, functionName: String = #function, line: Int = #line) throws {
static func assert(_ condition: Bool, file: String = #file, functionName: String = #function, line: Int = #line) throws {
if !condition {
print(" \(file):\(line) \(functionName) **FAILED**")
throw "atpkg.tests.failed"
......
......@@ -167,7 +167,7 @@ class PackageTests: Test {
try test.assert(c_default_qualified["name"]?.string == "c_default")
//check package dependency graph
let _ = package.prunedDependencyGraph(a_default_unqualified)
let _ = package.prunedDependencyGraph(task: a_default_unqualified)
}
......@@ -195,7 +195,7 @@ class PackageTests: Test {
try test.assert(c_default_qualified["name"]?.string == "c_default")
//check package dependency graph
let _ = package.prunedDependencyGraph(a_default_unqualified)
let _ = package.prunedDependencyGraph(task: a_default_unqualified)
//check each import path
try test.assert(a_default_unqualified.importedPath == "./tests/collateral/import_paths/")
......
......@@ -24,14 +24,14 @@ class SubstitutionTests: Test {
static func testBasic() throws {
let filepath = "./tests/collateral/basic.atpkg"
let package = try Package(filepath: filepath, overlay: [], focusOnTask: nil)
try test.assert(evaluateSubstitutions("${test_substitution}", package: package) == "test_substitution")
try test.assert(evaluateSubstitutions("foobly-doobly-doo ${test_substitution} doobly-doo", package: package) == "foobly-doobly-doo test_substitution doobly-doo")
try test.assert(evaluateSubstitutions("foobly-doobly-doo \\${test_substitution} doobly-doo", package: package) == "foobly-doobly-doo ${test_substitution} doobly-doo")
try test.assert(evaluateSubstitutions(input: "${test_substitution}", package: package) == "test_substitution")
try test.assert(evaluateSubstitutions(input: "foobly-doobly-doo ${test_substitution} doobly-doo", package: package) == "foobly-doobly-doo test_substitution doobly-doo")
try test.assert(evaluateSubstitutions(input: "foobly-doobly-doo \\${test_substitution} doobly-doo", package: package) == "foobly-doobly-doo ${test_substitution} doobly-doo")
}
static func testCollectSources() throws {
let filepath = "./tests/collateral/collect_sources/build.atpkg"
let package = try Package(filepath: filepath, overlay: [], focusOnTask: nil)
try test.assert(evaluateSubstitutions("${collect_sources:default}", package: package) == "./tests/collateral/collect_sources/src/a.swift ./tests/collateral/collect_sources/src/b.swift")
try test.assert(evaluateSubstitutions(input: "${collect_sources:default}", package: package) == "./tests/collateral/collect_sources/src/a.swift ./tests/collateral/collect_sources/src/b.swift")
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment