Files
swift-inotify/Tests/InotifyIntegrationTests/InotifyErrorTests.swift
T
T. R. Bernstein 3215d2eb5a Describe the errno an error stores, not the current one
The description looked up the message of whatever errno was set when
the description was built, so an error printed later read
"Success (errno 28)".
2026-09-19 00:45:22 +02:00

12 lines
342 B
Swift

import Testing
@testable import Inotify
@Suite("Error Description")
struct InotifyErrorTests {
@Test func describesTheStoredErrnoAndNotTheCurrentOne() {
let error = InotifyError.addWatchFailed(path: "/watched", errno: 28)
#expect(error.description == "inotify_add_watch failed for '/watched': No space left on device (errno 28)")
}
}