Files
orca/tests/e2e/select-input-source.swift
T
Neil 886a1fd2ef test(e2e): track the input-source selector the macOS specs shell out to
Five tracked macOS IME specs ran `swift .tmp/select-input-source.swift`, a
file that is gitignored and existed only on one machine. Anyone else
checking out the repo — or the same machine after .tmp is cleaned — could
not run them, and they are the capture drivers for the macOS rows that are
blocked waiting for exactly those runs.

Moves it to tests/e2e/ beside its callers. The chord spec now resolves it
from __dirname rather than reaching two levels up into .tmp.
2026-08-06 07:36:35 -07:00

15 lines
405 B
Swift

import Carbon
guard CommandLine.arguments.count == 2 else {
exit(2)
}
let properties = [kTISPropertyInputSourceID: CommandLine.arguments[1] as CFString] as CFDictionary
let sources = TISCreateInputSourceList(properties, true).takeRetainedValue() as! [TISInputSource]
guard let source = sources.first else {
exit(3)
}
TISEnableInputSource(source)
exit(TISSelectInputSource(source) == noErr ? 0 : 4)