mirror of
https://github.com/nicoverbruggen/phpmon.git
synced 2025-11-07 05:10:06 +01:00
✅ Fix tests
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user