Fix lint issues.

This commit is contained in:
Brent Simmons 2025-01-22 22:39:38 -08:00
parent b7f82944c7
commit ef4ae1bffe
5 changed files with 64 additions and 81 deletions

View File

@ -10,14 +10,6 @@ import XCTest
class AppleScriptXCTestCase: XCTestCase {
override func setUp() {
super.setUp()
}
override func tearDown() {
super.tearDown()
}
/*
@function doIndividualScript
@param filename -- name of a .applescript (sans extension) in the test bundle's
@ -29,7 +21,7 @@ class AppleScriptXCTestCase: XCTestCase {
@return the value of script_result, if any
*/
func doIndividualScript(filename: String) -> NSAppleEventDescriptor? {
var errorDict: NSDictionary? = nil
var errorDict: NSDictionary?
let testBundle = Bundle(for: type(of: self))
let url = testBundle.url(forResource: filename, withExtension: "scpt")
guard let testScriptUrl = url else {
@ -44,7 +36,7 @@ class AppleScriptXCTestCase: XCTestCase {
}
let scriptResult = testScript.executeAndReturnError(&errorDict)
if (errorDict != nil) {
if errorDict != nil {
print("error is \(String(describing: errorDict))")
XCTFail("Failed executing script")
return nil
@ -56,7 +48,7 @@ class AppleScriptXCTestCase: XCTestCase {
return nil
}
if (testResult.booleanValue != true) {
if testResult.booleanValue != true {
print("test_result was \(testResult)")
print("script_result was \(String(describing: usrfDictionary["script_result"]))")
}

View File

@ -27,13 +27,13 @@ extension NSAppleEventDescriptor {
return [:]
}
let listCount = usrfList.numberOfItems
guard (listCount%2 == 0) else {
guard listCount%2 == 0 else {
print("error: usrfDictionary() expected even number of items in usrf")
return [:]
}
var usrfDictionary: [String: NSAppleEventDescriptor] = [:]
var processedItems = 0
while (processedItems < listCount) {
while processedItems < listCount {
processedItems = processedItems + 2
guard let nthlabel = usrfList.atIndex(processedItems-1) else {
print("usrfDictionary() couldn't get item \(processedItems+1) in usrf list")
@ -49,6 +49,6 @@ extension NSAppleEventDescriptor {
}
usrfDictionary[nthLabelString] = nthvalue
}
return usrfDictionary;
return usrfDictionary
}
}

View File

@ -10,15 +10,6 @@ import XCTest
class ScriptingTests: AppleScriptXCTestCase {
override func setUp() {
super.setUp()
}
override func tearDown() {
super.tearDown()
}
/*
@function testGenericScript
@brief An example of how a script can be run as part of an XCTest

View File

@ -19,7 +19,7 @@ class SharingTests: XCTestCase {
sharingService.delegate = sharingServiceDelegate
sharingService.perform(withItems: [
ArticlePasteboardWriter(article: article(titled: "Immunization")),
ArticlePasteboardWriter(article: article(titled: "Immunization"))
])
XCTAssertEqual("Immunization", sharingService.subject)
@ -32,7 +32,7 @@ class SharingTests: XCTestCase {
sharingService.delegate = sharingServiceDelegate
sharingService.perform(withItems: [
ArticlePasteboardWriter(article: article(titled: "NetNewsWire Status: Almost Beta")),
ArticlePasteboardWriter(article: article(titled: "No Algorithms Follow-Up")),
ArticlePasteboardWriter(article: article(titled: "No Algorithms Follow-Up"))
])
XCTAssertEqual("NetNewsWire Status: Almost Beta, No Algorithms Follow-Up", sharingService.subject)