diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 92509ac..9606f58 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest] + os: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.os }} timeout-minutes: 15 steps: diff --git a/src/client.zig b/src/client.zig index 22bcbc1..88b6d6d 100644 --- a/src/client.zig +++ b/src/client.zig @@ -1685,7 +1685,11 @@ test "lastError only describes the most recent request" { server.deinit(io); // nobody listens on the port any more listening = false; body.clearRetainingCapacity(); - try testing.expectError(error.ConnectionRefused, client.fetch(.{ .url = url }, &body.writer)); + // On Windows, Zig 0.16.0 reports a refused connection as + // error.Unexpected: std.Io.Threaded.netConnectIpWindows does not map + // STATUS_CONNECTION_REFUSED. + const refused = if (builtin.os.tag == .windows) error.Unexpected else error.ConnectionRefused; + try testing.expectError(refused, client.fetch(.{ .url = url }, &body.writer)); try testing.expectEqual(@as(?ErrorInfo, null), client.lastError()); }