1const std = @import("std");
2const url = @import("url");
3const expect = @import("expect").expect;
4
5test {
6 _ = @import("./zig-out/test.zig");
7}
8
9test {
10 _ = @import("./test.SearchParams.zig");
11}
12
13test {
14 const allocator = std.testing.allocator;
15 const u = try url.URL.parse(allocator, "https://en.wikipedia.org/w/index.php?title=URL", null);
16 defer allocator.free(u.href);
17 try expect(u.host).toEqualString("en.wikipedia.org");
18 var search = try u.searchParams(allocator);
19 defer search.deinit();
20 try expect(search.get("title")).toEqualString("URL");
21}