@@ -219,14 +219,16 @@ test "parse + json parse" {
219
219
\\{
220
220
\\ "ipv4": "127.0.0.1",
221
221
\\ "address": "10.0.0.1",
222
- \\ "endpoint": "8.8.4.4:53"
222
+ \\ "endpoint": "8.8.4.4:53",
223
+ \\ "ipv6_endpoint": "::1:53"
223
224
\\}
224
225
;
225
226
226
227
const Wrapper = struct {
227
228
ipv4 : network.Address.IPv4 ,
228
229
address : network.Address ,
229
230
endpoint : network.EndPoint ,
231
+ ipv6_endpoint : network.EndPoint ,
230
232
};
231
233
232
234
const wrapper = try std .json .parseFromSliceLeaky (
@@ -242,6 +244,13 @@ test "parse + json parse" {
242
244
.address = .{ .ipv4 = network .Address .IPv4 .init (8 , 8 , 4 , 4 ) },
243
245
.port = 53 ,
244
246
}, wrapper .endpoint );
247
+
248
+ var expected_addr = network .Address .IPv6 .init (.{0 } ** 16 , 0 );
249
+ expected_addr .value [15 ] = 1 ;
250
+ try std .testing .expectEqual (network.EndPoint {
251
+ .address = .{ .ipv6 = expected_addr },
252
+ .port = 53 ,
253
+ }, wrapper .ipv6_endpoint );
245
254
}
246
255
247
256
test "Darwin: connection-mode socket was connected already" {
@@ -285,7 +294,6 @@ test "Darwin: connection-mode socket was connected already" {
285
294
}
286
295
};
287
296
288
-
289
297
var srv : Server = .{};
290
298
try srv .start ();
291
299
defer srv .waitFinish ();
0 commit comments