46 lines · 1.3 KB · Swift
RawDownload
import CodexBarCoreimport Testing @Suitestruct PlatformGatingTests {    @Test    func claudeWebFetcher_isNotSupportedOnLinux() async {        #if os(Linux)        let error = await #expect(throws: ClaudeWebAPIFetcher.FetchError.self) {            _ = try await ClaudeWebAPIFetcher.fetchUsage()        }        let isExpectedError = error.map { thrown in            if case .notSupportedOnThisPlatform = thrown { return true }            return false        } ?? false        #expect(isExpectedError)        #else        #expect(Bool(true))        #endif    }     @Test    func claudeWebFetcher_hasSessionKey_isFalseOnLinux() {        #if os(Linux)        #expect(ClaudeWebAPIFetcher.hasSessionKey(cookieHeader: nil) == false)        #else        #expect(Bool(true))        #endif    }     @Test    func claudeWebFetcher_sessionKeyInfo_throwsOnLinux() {        #if os(Linux)        let error = #expect(throws: ClaudeWebAPIFetcher.FetchError.self) {            _ = try ClaudeWebAPIFetcher.sessionKeyInfo()        }        let isExpectedError = error.map { thrown in            if case .notSupportedOnThisPlatform = thrown { return true }            return false        } ?? false        #expect(isExpectedError)        #else        #expect(Bool(true))        #endif    }}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t