1
0
mirror of https://github.com/nicoverbruggen/phpmon.git synced 2025-11-07 05:10:06 +01:00

Fix tests

This commit is contained in:
2023-02-26 14:45:15 +01:00
parent 81eb2fee90
commit c7eb1d5ce5
5 changed files with 13 additions and 8 deletions

View File

@@ -15,7 +15,7 @@ class AppVersion: Comparable {
init(version: String, build: String?, suffix: String? = nil) {
self.version = version
self.build = Int(build ?? "0")
self.build = build == nil ? nil : Int(build!)
self.suffix = suffix
}

View File

@@ -40,12 +40,17 @@ struct CaskFile {
let lines = string.split(separator: "\n")
.filter { $0 != "" }
.map { line in
return line.trimmingCharacters(in: .whitespacesAndNewlines)
}
if lines.count < 4 {
Log.err("The CaskFile is <4 lines long, which is too short")
return nil
}
print(lines)
if !lines.first!.starts(with: "cask") || !lines.last!.starts(with: "end") {
Log.err("The CaskFile does not start with 'cask' or does not end with 'end'")
return nil