mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Fix lint issues.
This commit is contained in:
@@ -9,14 +9,6 @@
|
||||
import XCTest
|
||||
|
||||
class AppleScriptXCTestCase: XCTestCase {
|
||||
|
||||
override func setUp() {
|
||||
super.setUp()
|
||||
}
|
||||
|
||||
override func tearDown() {
|
||||
super.tearDown()
|
||||
}
|
||||
|
||||
/*
|
||||
@function doIndividualScript
|
||||
@@ -28,39 +20,39 @@ class AppleScriptXCTestCase: XCTestCase {
|
||||
if the test_result is false or is missing, the test fails
|
||||
@return the value of script_result, if any
|
||||
*/
|
||||
func doIndividualScript(filename:String) -> NSAppleEventDescriptor? {
|
||||
var errorDict: NSDictionary? = nil
|
||||
func doIndividualScript(filename: String) -> NSAppleEventDescriptor? {
|
||||
var errorDict: NSDictionary?
|
||||
let testBundle = Bundle(for: type(of: self))
|
||||
let url = testBundle.url(forResource:filename, withExtension:"scpt")
|
||||
let url = testBundle.url(forResource: filename, withExtension: "scpt")
|
||||
guard let testScriptUrl = url else {
|
||||
XCTFail("Failed Getting script URL")
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
guard let testScript = NSAppleScript(contentsOf: testScriptUrl, error: &errorDict) else {
|
||||
print ("error is \(String(describing: errorDict))")
|
||||
print("error is \(String(describing: errorDict))")
|
||||
XCTFail("Failed initializing NSAppleScript")
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
let scriptResult = testScript.executeAndReturnError(&errorDict)
|
||||
if (errorDict != nil) {
|
||||
print ("error is \(String(describing: errorDict))")
|
||||
if errorDict != nil {
|
||||
print("error is \(String(describing: errorDict))")
|
||||
XCTFail("Failed executing script")
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
let usrfDictionary = scriptResult.usrfDictionary()
|
||||
guard let testResult = usrfDictionary["test_result"] else {
|
||||
XCTFail("test script didn't return test result in usrf")
|
||||
return nil
|
||||
}
|
||||
|
||||
if (testResult.booleanValue != true) {
|
||||
|
||||
if testResult.booleanValue != true {
|
||||
print("test_result was \(testResult)")
|
||||
print("script_result was \(String(describing: usrfDictionary["script_result"]))")
|
||||
}
|
||||
|
||||
|
||||
XCTAssert(testResult.booleanValue == true, "test_result should be true")
|
||||
return usrfDictionary["script_result"]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user