Commit 498a38bc authored by Drew's avatar Drew

Overlaying for BoolLiteral

parent 80f4cb62
Pipeline #762 passed with stage
......@@ -106,6 +106,13 @@ final public class Task {
}
self.kvp[optionName] = ParseValue.StringLiteral(str)
case ParseValue.BoolLiteral(let b):
if let existingValue = self[optionName] {
fatalError("Can't overlay on \(self.key)[\(optionName)] which already has a value \(existingValue)")
}
self.kvp[optionName] = ParseValue.BoolLiteral(b)
default:
fatalError("Canot overlay value \(optionValue); please file a bug")
}
......
......@@ -20,6 +20,9 @@
:emptyVecOption {
:emptyVecOption ["OVERLAY"]
}
:boolOption {
:boolOption true
}
}
:tasks {
......
......@@ -114,6 +114,11 @@ class PackageTests: Test {
try test.assert(vecOption[0].string == "OVERLAY")
guard let package7 = Package(filepath: filepath, overlay: ["boolOption"]) else { print("error"); try test.assert(false); return }
guard let boolOption = package7.tasks["build"]?["boolOption"]?.bool else {
fatalError("no bool option?")
}
try test.assert(boolOption == true)
}
static func testExportedOverlays() throws {
......
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