mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2026-12-05 19:57:31 +00:00
45 lines
1.3 KiB
Swift
45 lines
1.3 KiB
Swift
//
|
||
// ScriptingTests.swift
|
||
// NetNewsWireTests
|
||
//
|
||
// Created by Olof Hellman on 1/7/18.
|
||
// Copyright © 2018 Olof Hellman. All rights reserved.
|
||
//
|
||
|
||
import Foundation
|
||
import Testing
|
||
|
||
/// Set by NetNewsWire-CI.xctestplan. Test plan skippedTests entries don’t skip these Swift Testing tests.
|
||
private let skipScriptingTestsEnvironmentKey = "SKIP_SCRIPTING_TESTS"
|
||
|
||
@MainActor @Suite(.disabled(if: ProcessInfo.processInfo.environment[skipScriptingTestsEnvironmentKey] != nil, "AppleScript tests can’t run on CI")) struct ScriptingTests {
|
||
|
||
// An example of how a script can be run as part of a test.
|
||
// The script returns {test_result:true, script_result:"Geoducks!"}.
|
||
// runTestScript verifies test_result. This test verifies script_result.
|
||
@Test func genericScript() {
|
||
let scriptResult = runTestScript(named: "testGenericScript")
|
||
#expect(scriptResult?.stringValue == "Geoducks!")
|
||
}
|
||
|
||
@Test func getURLScript() {
|
||
runTestScript(named: "testGetURL")
|
||
}
|
||
|
||
@Test func nameAndURLOfEveryFeedScript() {
|
||
runTestScript(named: "testNameAndUrlOfEveryFeed")
|
||
}
|
||
|
||
@Test func nameOfEveryFolderScript() {
|
||
runTestScript(named: "testNameOfEveryFolder")
|
||
}
|
||
|
||
@Test func nameOfAuthorsScript() {
|
||
runTestScript(named: "testNameOfAuthors")
|
||
}
|
||
|
||
@Test func feedExists() {
|
||
runTestScript(named: "testFeedExists")
|
||
}
|
||
}
|