mirror of
https://github.com/samsonjs/Peekaboo.git
synced 2026-04-27 15:07:41 +00:00
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:
parent
f4a41f8355
commit
8894154be6
5 changed files with 185 additions and 187 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
import XCTest
|
|
||||||
@testable import peekaboo
|
@testable import peekaboo
|
||||||
|
import XCTest
|
||||||
|
|
||||||
final class ApplicationFinderTests: XCTestCase {
|
final class ApplicationFinderTests: XCTestCase {
|
||||||
var applicationFinder: ApplicationFinder!
|
var applicationFinder: ApplicationFinder!
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,8 @@
|
||||||
import XCTest
|
|
||||||
import ArgumentParser
|
import ArgumentParser
|
||||||
@testable import peekaboo
|
@testable import peekaboo
|
||||||
|
import XCTest
|
||||||
|
|
||||||
final class ImageCommandTests: XCTestCase {
|
final class ImageCommandTests: XCTestCase {
|
||||||
|
|
||||||
// MARK: - Command Parsing Tests
|
// MARK: - Command Parsing Tests
|
||||||
|
|
||||||
func testImageCommandParsing() throws {
|
func testImageCommandParsing() throws {
|
||||||
|
|
@ -129,7 +128,7 @@ final class ImageCommandTests: XCTestCase {
|
||||||
func testGenerateFilename() {
|
func testGenerateFilename() {
|
||||||
// Test filename generation with pattern
|
// Test filename generation with pattern
|
||||||
let pattern = "{app}_{mode}_{timestamp}"
|
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
|
// Mock the filename generation logic
|
||||||
let formatter = DateFormatter()
|
let formatter = DateFormatter()
|
||||||
|
|
@ -184,7 +183,7 @@ final class ImageCommandTests: XCTestCase {
|
||||||
metadata: ImageMetadata(
|
metadata: ImageMetadata(
|
||||||
width: 1920,
|
width: 1920,
|
||||||
height: 1080,
|
height: 1080,
|
||||||
fileSize: 1024000,
|
fileSize: 1_024_000,
|
||||||
format: "png",
|
format: "png",
|
||||||
colorSpace: "sRGB",
|
colorSpace: "sRGB",
|
||||||
bitsPerPixel: 24,
|
bitsPerPixel: 24,
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,8 @@
|
||||||
import XCTest
|
|
||||||
import ArgumentParser
|
import ArgumentParser
|
||||||
@testable import peekaboo
|
@testable import peekaboo
|
||||||
|
import XCTest
|
||||||
|
|
||||||
final class ListCommandTests: XCTestCase {
|
final class ListCommandTests: XCTestCase {
|
||||||
|
|
||||||
// MARK: - Command Parsing Tests
|
// MARK: - Command Parsing Tests
|
||||||
|
|
||||||
func testListCommandParsing() throws {
|
func testListCommandParsing() throws {
|
||||||
|
|
@ -182,7 +181,7 @@ final class ListCommandTests: XCTestCase {
|
||||||
let specifier = WindowSpecifier.app("Finder")
|
let specifier = WindowSpecifier.app("Finder")
|
||||||
|
|
||||||
switch specifier {
|
switch specifier {
|
||||||
case .app(let name):
|
case let .app(name):
|
||||||
XCTAssertEqual(name, "Finder")
|
XCTAssertEqual(name, "Finder")
|
||||||
default:
|
default:
|
||||||
XCTFail("Expected app specifier")
|
XCTFail("Expected app specifier")
|
||||||
|
|
@ -194,7 +193,7 @@ final class ListCommandTests: XCTestCase {
|
||||||
let specifier = WindowSpecifier.windowId(123)
|
let specifier = WindowSpecifier.windowId(123)
|
||||||
|
|
||||||
switch specifier {
|
switch specifier {
|
||||||
case .windowId(let id):
|
case let .windowId(id):
|
||||||
XCTAssertEqual(id, 123)
|
XCTAssertEqual(id, 123)
|
||||||
default:
|
default:
|
||||||
XCTFail("Expected windowId specifier")
|
XCTFail("Expected windowId specifier")
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import XCTest
|
|
||||||
@testable import peekaboo
|
@testable import peekaboo
|
||||||
|
import XCTest
|
||||||
|
|
||||||
final class PermissionsCheckerTests: XCTestCase {
|
final class PermissionsCheckerTests: XCTestCase {
|
||||||
var permissionsChecker: PermissionsChecker!
|
var permissionsChecker: PermissionsChecker!
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import XCTest
|
|
||||||
@testable import peekaboo
|
@testable import peekaboo
|
||||||
|
import XCTest
|
||||||
|
|
||||||
final class WindowManagerTests: XCTestCase {
|
final class WindowManagerTests: XCTestCase {
|
||||||
var windowManager: WindowManager!
|
var windowManager: WindowManager!
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue