native macOS codings agent orchestrator prowl.onev.cat
Something went wrong. Try again.
1.1 kB · 25 lines
Swift
1234567891011121314151617181920212223242526import AppKitimport Testing
@testable import supacode
struct CommandKeyObserverTests { @Test func shouldShowShortcutsForBareCommandOrControl() { #expect(CommandKeyObserver.shouldShowShortcuts(for: [.command])) #expect(CommandKeyObserver.shouldShowShortcuts(for: [.control])) }
@Test func shouldNotShowShortcutsForShortcutCombinations() { #expect(CommandKeyObserver.shouldShowShortcuts(for: [.command, .shift]) == false) #expect(CommandKeyObserver.shouldShowShortcuts(for: [.control, .option]) == false) #expect(CommandKeyObserver.shouldShowShortcuts(for: [.command, .control]) == false) #expect(CommandKeyObserver.shouldShowShortcuts(for: [.command, .control, .shift]) == false) }
@Test func shouldNotShowShortcutsForNonHintModifiers() { #expect(CommandKeyObserver.shouldShowShortcuts(for: []) == false) #expect(CommandKeyObserver.shouldShowShortcuts(for: [.shift]) == false) #expect(CommandKeyObserver.shouldShowShortcuts(for: [.option]) == false) #expect(CommandKeyObserver.shouldShowShortcuts(for: [.shift, .option]) == false) }}