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

45 lines
1.3 KiB
Swift
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
//
// 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")
}
}