Apply SwiftFormat to new test files

- Fix import ordering (XCTest after module imports)
- Add missing newlines at end of files
- Fix number formatting (underscore separators)
- Apply consistent formatting to switch statements
This commit is contained in:
Peter Steinberger 2025-05-25 19:13:44 +02:00
parent f4a41f8355
commit 8894154be6
5 changed files with 185 additions and 187 deletions

View file

@ -1,5 +1,5 @@
import XCTest
@testable import peekaboo
import XCTest
final class ApplicationFinderTests: XCTestCase {
var applicationFinder: ApplicationFinder!

View file

@ -1,9 +1,8 @@
import XCTest
import ArgumentParser
@testable import peekaboo
import XCTest
final class ImageCommandTests: XCTestCase {
// MARK: - Command Parsing Tests
func testImageCommandParsing() throws {
@ -129,7 +128,7 @@ final class ImageCommandTests: XCTestCase {
func testGenerateFilename() {
// Test filename generation with pattern
let pattern = "{app}_{mode}_{timestamp}"
let date = Date(timeIntervalSince1970: 1700000000) // Fixed date for testing
let date = Date(timeIntervalSince1970: 1_700_000_000) // Fixed date for testing
// Mock the filename generation logic
let formatter = DateFormatter()
@ -184,7 +183,7 @@ final class ImageCommandTests: XCTestCase {
metadata: ImageMetadata(
width: 1920,
height: 1080,
fileSize: 1024000,
fileSize: 1_024_000,
format: "png",
colorSpace: "sRGB",
bitsPerPixel: 24,

View file

@ -1,9 +1,8 @@
import XCTest
import ArgumentParser
@testable import peekaboo
import XCTest
final class ListCommandTests: XCTestCase {
// MARK: - Command Parsing Tests
func testListCommandParsing() throws {
@ -182,7 +181,7 @@ final class ListCommandTests: XCTestCase {
let specifier = WindowSpecifier.app("Finder")
switch specifier {
case .app(let name):
case let .app(name):
XCTAssertEqual(name, "Finder")
default:
XCTFail("Expected app specifier")
@ -194,7 +193,7 @@ final class ListCommandTests: XCTestCase {
let specifier = WindowSpecifier.windowId(123)
switch specifier {
case .windowId(let id):
case let .windowId(id):
XCTAssertEqual(id, 123)
default:
XCTFail("Expected windowId specifier")

View file

@ -1,5 +1,5 @@
import XCTest
@testable import peekaboo
import XCTest
final class PermissionsCheckerTests: XCTestCase {
var permissionsChecker: PermissionsChecker!

View file

@ -1,5 +1,5 @@
import XCTest
@testable import peekaboo
import XCTest
final class WindowManagerTests: XCTestCase {
var windowManager: WindowManager!