import { describe, it, expect } from "bun:test"; describe("url", () => { it("prints", () => { expect(Bun.inspect(new URL("https://example.com"))).toBe( "https://example.com/", ); expect( Bun.inspect( new URL( "https://github.com/oven-sh/bun/issues/135?hello%20i%20have%20spaces%20thank%20you%20good%20night", ), ), ).toBe( "https://github.com/oven-sh/bun/issues/135?hello%20i%20have%20spaces%20thank%20you%20good%20night", ); }); it("works", () => { const inputs = [ [ "https://username:password@api.foo.bar.com:9999/baz/okay/i/123?ran=out&of=things#to-use-as-a-placeholder", { hash: "#to-use-as-a-placeholder", host: "api.foo.bar.com:9999", hostname: "api.foo.bar.com", href: "https://username:password@api.foo.bar.com:9999/baz/okay/i/123?ran=out&of=things#to-use-as-a-placeholder", origin: "https://api.foo.bar.com:9999", password: "password", pathname: "/baz/okay/i/123", port: "9999", protocol: "https:", search: "?ran=out&of=things", username: "username", }, ], [ "https://url.spec.whatwg.org/#url-serializing", { hash: "#url-serializing", host: "url.spec.whatwg.org", hostname: "url.spec.whatwg.org", href: "https://url.spec.whatwg.org/#url-serializing", origin: "https://url.spec.whatwg.org", password: "", pathname: "/", port: "", protocol: "https:", search: "", username: "", }, ], [ "https://url.spec.whatwg.org#url-serializing", { hash: "#url-serializing", host: "url.spec.whatwg.org", hostname: "url.spec.whatwg.org", href: "https://url.spec.whatwg.org/#url-serializing", origin: "https://url.spec.whatwg.org", password: "", pathname: "/", port: "", protocol: "https:", search: "", username: "", }, ], ] as const; for (let [url, values] of inputs) { const result = new URL(url); expect(result.hash).toBe(values.hash); expect(result.host).toBe(values.host); expect(result.hostname).toBe(values.hostname); expect(result.href).toBe(values.href); expect(result.password).toBe(values.password); expect(result.pathname).toBe(values.pathname); expect(result.port).toBe(values.port); expect(result.protocol).toBe(values.protocol); expect(result.search).toBe(values.search); expect(result.username).toBe(values.username); } }); }); >/net/internal/socket/msghdr_bsdvar.go (unfollow)
AgeCommit message (Expand)AuthorFilesLines
2018-02-03Add support for base URLs with subfoldersGravatar Frédéric Guillot 10-23/+105
2018-02-01Update German translationGravatar stratmaster 2-4/+12
2018-01-31Add missing about menu in settingsGravatar Frédéric Guillot 5-5/+29
2018-01-31Show API URL endpoints in user interfaceGravatar Frédéric Guillot 11-14/+99
2018-01-29Do not update entry date while refreshing a feedGravatar Frédéric Guillot 1-4/+5
2018-01-29Enable debug mode for integration testsGravatar Frédéric Guillot 1-1/+1
2018-01-29Add the possiblity to enable debug mode with an environment variableGravatar Frédéric Guillot 2-1/+6
2018-01-29Keep code base tidyGravatar Frédéric Guillot 5-18/+16
2018-01-29Add flag to enable debug loggingGravatar Rogier Lommers 2-7/+64
2018-01-25Improve unread counter updatesGravatar Mahendra Kalkura 1-6/+35