mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Create AppKitExtras tests. Add it to test plan. Add parser tests to test plan.
This commit is contained in:
@@ -0,0 +1,79 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "1530"
|
||||
version = "1.7">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES"
|
||||
buildArchitectures = "Automatic">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "AppKitExtras"
|
||||
BuildableName = "AppKitExtras"
|
||||
BlueprintName = "AppKitExtras"
|
||||
ReferencedContainer = "container:">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
shouldAutocreateTestPlan = "YES">
|
||||
<Testables>
|
||||
<TestableReference
|
||||
skipped = "NO">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "AppKitExtrasTests"
|
||||
BuildableName = "AppKitExtrasTests"
|
||||
BlueprintName = "AppKitExtrasTests"
|
||||
ReferencedContainer = "container:">
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
</Testables>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "AppKitExtras"
|
||||
BuildableName = "AppKitExtras"
|
||||
BlueprintName = "AppKitExtras"
|
||||
ReferencedContainer = "container:">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
@@ -0,0 +1,54 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "1530"
|
||||
version = "1.7">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES"
|
||||
buildArchitectures = "Automatic">
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
shouldAutocreateTestPlan = "YES">
|
||||
<Testables>
|
||||
<TestableReference
|
||||
skipped = "NO">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "AppKitExtrasTests"
|
||||
BuildableName = "AppKitExtrasTests"
|
||||
BlueprintName = "AppKitExtrasTests"
|
||||
ReferencedContainer = "container:">
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
</Testables>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
@@ -1,12 +0,0 @@
|
||||
import XCTest
|
||||
@testable import AppKitExtras
|
||||
|
||||
final class AppKitExtrasTests: XCTestCase {
|
||||
func testExample() throws {
|
||||
// XCTest Documentation
|
||||
// https://developer.apple.com/documentation/xctest
|
||||
|
||||
// Defining Test Cases and Test Methods
|
||||
// https://developer.apple.com/documentation/xctest/defining_test_cases_and_test_methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
//
|
||||
// NSMenuExtensionsTests.swift
|
||||
//
|
||||
//
|
||||
// Created by Brent Simmons on 5/18/24.
|
||||
//
|
||||
|
||||
#if os(macOS)
|
||||
|
||||
import AppKit
|
||||
import XCTest
|
||||
import AppKitExtras
|
||||
|
||||
final class NSMenuExtensionsTests: XCTestCase {
|
||||
|
||||
// MARK: - Test addSeparatorIfNeeded
|
||||
|
||||
func testAddSeparatorIfNeeded_NoSeparator() {
|
||||
|
||||
let menu = NSMenu(title: "Test")
|
||||
menu.addItem(menuItemForTesting())
|
||||
menu.addItem(menuItemForTesting())
|
||||
menu.addSeparatorIfNeeded()
|
||||
|
||||
XCTAssertTrue(menu.items.last!.isSeparatorItem)
|
||||
}
|
||||
|
||||
func testAddSeparatorIfNeeded_EmptyMenu() {
|
||||
|
||||
let menu = NSMenu(title: "Test")
|
||||
menu.addSeparatorIfNeeded()
|
||||
|
||||
// A separator should not be added to a menu with 0 items,
|
||||
// since a menu should never start with a separator item.
|
||||
XCTAssertEqual(menu.items.count, 0)
|
||||
}
|
||||
|
||||
func testAddSeparatorIfNeeded_HasSeparator() {
|
||||
|
||||
let menu = NSMenu(title: "Test")
|
||||
menu.addItem(menuItemForTesting())
|
||||
menu.addItem(menuItemForTesting())
|
||||
menu.addItem(.separator())
|
||||
|
||||
let menuItemsCount = menu.items.count
|
||||
|
||||
XCTAssertTrue(menu.items.last!.isSeparatorItem)
|
||||
|
||||
// Should not get added — last item is already separator
|
||||
menu.addSeparatorIfNeeded()
|
||||
// Make sure last item is still separator
|
||||
XCTAssertTrue(menu.items.last!.isSeparatorItem)
|
||||
// Count should be same as before calling `addSeparatorIfNeeded()`
|
||||
XCTAssertEqual(menu.items.count, menuItemsCount)
|
||||
}
|
||||
}
|
||||
|
||||
private extension NSMenuExtensionsTests {
|
||||
|
||||
private func menuItemForTesting(_ title: String = "Test NSMenuItem") -> NSMenuItem {
|
||||
NSMenuItem(title: title, action: nil, keyEquivalent: "")
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user