Skip to content

Commit

Permalink
misc: append newline when raising a fatal error
Browse files Browse the repository at this point in the history
  • Loading branch information
socsieng committed Dec 31, 2020
1 parent 27bcfc6 commit b33f495
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Sources/SendKeysLib/Commands/CommandExecutor.swift
Expand Up @@ -23,7 +23,7 @@ public class CommandExecutor: CommandExecutorProtocol {
case .mouseScroll:
executeMouseScroll(command)
default:
fatalError("Unrecognized command type \(command.type)")
fatalError("Unrecognized command type \(command.type)\n")
}
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/SendKeysLib/Commands/CommandMatcher.swift
Expand Up @@ -4,7 +4,7 @@ public class CommandMatcher {
let expression: NSRegularExpression

public func createCommand(_ arguments: [String?]) -> Command {
fatalError("Not implemented")
fatalError("Not implemented\n")
}

public init(_ expression: NSRegularExpression) {
Expand Down
2 changes: 1 addition & 1 deletion Sources/SendKeysLib/Commands/CommandsIterator.swift
Expand Up @@ -43,7 +43,7 @@ public class CommandsIterator: IteratorProtocol {

return command
} else {
fatalError("Unmatched sequence.")
fatalError("Unmatched sequence.\n")
}
}
return nil
Expand Down
2 changes: 1 addition & 1 deletion Sources/SendKeysLib/MouseController.swift
Expand Up @@ -97,7 +97,7 @@ class MouseController {
event?.setIntegerValueField(field, value: Int64(amount * -1))
event?.post(tap: CGEventTapLocation.cghidEventTap)
} else {
fatalError("Scrolling is only available on 10.13 or later")
fatalError("Scrolling is only available on 10.13 or later\n")
}
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/SendKeysLib/SendKeysCli.swift
Expand Up @@ -43,7 +43,7 @@ public struct SendKeysCli: ParsableCommand {
if let data = FileManager.default.contents(atPath: inputFile!) {
commandString = String(data: data, encoding: .utf8)
} else {
fatalError("Could not read file \(inputFile!)")
fatalError("Could not read file \(inputFile!)\n")
}
} else if !(characters ?? "").isEmpty {
commandString = characters
Expand Down
2 changes: 1 addition & 1 deletion Tests/SendKeysTests/sendkeysTests.swift
Expand Up @@ -36,7 +36,7 @@ final class sendkeysTests: XCTestCase {
for bundle in Bundle.allBundles where bundle.bundlePath.hasSuffix(".xctest") {
return bundle.bundleURL.deletingLastPathComponent()
}
fatalError("couldn't find the products directory")
fatalError("Couldn't find the products directory\n")
#else
return Bundle.main.bundleURL
#endif
Expand Down

0 comments on commit b33f495

Please sign in to comment.