Files
NetNewsWire/Tests/NetNewsWireTests/ScriptingTests/ScriptingTests.swift
T

53 lines
1.6 KiB
Swift
Raw Normal View History

//
// ScriptingTests.swift
2018-08-28 22:18:24 -07:00
// NetNewsWireTests
//
// Created by Olof Hellman on 1/7/18.
// Copyright © 2018 Olof Hellman. All rights reserved.
//
import XCTest
2025-11-18 19:58:48 -08:00
@MainActor final class ScriptingTests: AppleScriptXCTestCase {
/*
@function testGenericScript
@brief An example of how a script can be run as part of an XCTest
the applescript returns
{test_result:true, script_result:"Geoducks!"}
doIndividualScript() verifies the test_result portion
this code verifies the script_result portion
*/
func testGenericScript() {
let scriptResult = doIndividualScript(filename: "testGenericScript")
2025-12-31 11:38:56 -08:00
XCTAssert(scriptResult?.stringValue == "Geoducks!")
}
2025-11-05 11:22:10 -08:00
func testGetUrlScript() {
_ = doIndividualScript(filename: "testGetURL")
}
2025-11-05 11:22:10 -08:00
func testNameAndUrlOfEveryFeedScript() {
_ = doIndividualScript(filename: "testNameAndUrlOfEveryFeed")
}
2025-11-05 11:22:10 -08:00
func testNameOfEveryFolderScript() {
_ = doIndividualScript(filename: "testNameOfEveryFolder")
}
2025-11-05 11:22:10 -08:00
func testNameOfAuthorsScript() {
_ = doIndividualScript(filename: "testNameOfAuthors")
}
2025-11-05 11:22:10 -08:00
func testFeedExists() {
_ = doIndividualScript(filename: "testFeedExists")
}
2025-11-05 11:22:10 -08:00
2026-01-01 15:50:20 -08:00
func doIndividualScriptWithExpectation(filename: String) {
2018-02-11 01:20:30 -08:00
let scriptExpectation = self.expectation(description: filename+"expectation")
DispatchQueue.main.async {
2025-12-31 11:38:56 -08:00
_ = self.doIndividualScript(filename: filename)
2018-02-11 01:20:30 -08:00
scriptExpectation.fulfill()
}
2025-12-31 11:38:56 -08:00
self.wait(for: [scriptExpectation], timeout: 60)
2018-02-11 01:20:30 -08:00
}
}