Browse Source

Swiftformat.

pull/113/head
Abhishek Banthia 3 years ago
parent
commit
4dcd80e4e1
  1. 3
      Clocker/ClockerUnitTests/EventInfoTests.swift
  2. 7
      Clocker/ClockerUnitTests/StandardMenubarHandlerTests.swift
  3. 2
      Clocker/Overall App/AppKit + Additions.swift
  4. 2
      Clocker/Preferences/App Feedback/AppFeedbackWindowController.swift

3
Clocker/ClockerUnitTests/EventInfoTests.swift

@ -1,8 +1,8 @@
// Copyright © 2015 Abhishek Banthia
import XCTest
@testable import Clocker
import EventKit
import XCTest
class EventInfoTests: XCTestCase {
private let eventStore = EKEventStore()
@ -76,5 +76,4 @@ class EventInfoTests: XCTestCase {
XCTAssert(mockEventInfo.metadataForMeeting() == "in 25h",
"Metadata for meeting: \(mockEventInfo.metadataForMeeting()) doesn't match expectation")
}
}

7
Clocker/ClockerUnitTests/StandardMenubarHandlerTests.swift

@ -1,8 +1,8 @@
// Copyright © 2015 Abhishek Banthia
import CoreModelKit
import XCTest
import EventKit
import XCTest
@testable import Clocker
@ -128,7 +128,6 @@ class StandardMenubarHandlerTests: XCTestCase {
let menubarHandler = MenubarTitleProvider(with: store)
XCTAssert(menubarHandler.format(event: mockEvent) == "Mock Title in 10m",
"Suffix \(menubarHandler.format(event: mockEvent)) doesn't match expectation")
}
func testUpcomingEventHappeningWithinOneMinute() {
@ -142,7 +141,6 @@ class StandardMenubarHandlerTests: XCTestCase {
let menubarHandler = MenubarTitleProvider(with: store)
XCTAssert(menubarHandler.format(event: mockEvent) == "Mock Title in 1m",
"Suffix \(menubarHandler.format(event: mockEvent)) doesn't match expectation")
}
func testUpcomingEventHappeningWithinSeconds() {
@ -156,7 +154,6 @@ class StandardMenubarHandlerTests: XCTestCase {
let menubarHandler = MenubarTitleProvider(with: store)
XCTAssert(menubarHandler.format(event: mockEvent) == "Mock Title starts now.",
"Suffix \(menubarHandler.format(event: mockEvent)) doesn't match expectation")
}
func testEmptyUpcomingEvent() {
@ -169,7 +166,6 @@ class StandardMenubarHandlerTests: XCTestCase {
let menubarHandler = MenubarTitleProvider(with: store)
XCTAssert(menubarHandler.format(event: mockEvent) == CLEmptyString,
"Suffix \(menubarHandler.format(event: mockEvent)) doesn't match expectation")
}
func testLongUpcomingEvent() {
@ -183,6 +179,5 @@ class StandardMenubarHandlerTests: XCTestCase {
let menubarHandler = MenubarTitleProvider(with: store)
XCTAssert(menubarHandler.format(event: mockEvent) == "Really long calendar event tit... starts now.",
"Suffix \(menubarHandler.format(event: mockEvent)) doesn't match expectation")
}
}

2
Clocker/Overall App/AppKit + Additions.swift

@ -21,7 +21,7 @@ extension NSTextField {
}
extension NSFont {
func size(_ string: String, _ width: Double, attributes: [NSAttributedString.Key: AnyObject]) -> CGSize {
func size(for string: String, width: Double, attributes: [NSAttributedString.Key: AnyObject]) -> CGSize {
let size = CGSize(width: width,
height: Double.greatestFiniteMagnitude)

2
Clocker/Preferences/App Feedback/AppFeedbackWindowController.swift

@ -210,7 +210,7 @@ class AppFeedbackWindowController: NSWindowController {
AppFeedbackConstants.CLClockerVersion: versionInfo,
AppFeedbackConstants.CLAppFeedbackDateProperty: todaysDate(),
AppFeedbackConstants.CLAppFeedbackUserPreferences: generateUserPreferences(),
AppFeedbackConstants.CLFeedbackEntryPoint: appFeedbackWindowDelegate?.appFeedbackWindoEntryPoint() ?? "Error"
AppFeedbackConstants.CLFeedbackEntryPoint: appFeedbackWindowDelegate?.appFeedbackWindoEntryPoint() ?? "Error",
]
}

Loading…
Cancel
Save