Repository: microsoft/PowerToys
File: src/modules/launcher/Plugins/Microsoft.Plugin.Uri.UnitTests/UriHelper/ExtendedUriParserTests.cs (C#)

Code before:
        [DataRow(null, false, null, false, null)]
        [DataRow("bing.com/search?q=gmx", true, "https://bing.com/search?q=gmx", true, null)]
        [DataRow("http://bing.com/search?q=gmx", true, "http://bing.com/search?q=gmx", true, null)]
        [DataRow("h", true, "https://h/", true, null)]
        [DataRow("http://h", true, "http://h/", true, null)]
        [DataRow("ht", true, "https://ht/", true, null)]
        [DataRow("http://ht", true, "http://ht/", true, null)]
        [DataRow("htt", true, "https://htt/", true, null)]
        [DataRow("http://htt", true, "http://htt/", true, null)]
        [DataRow("http", true, "https://http/", true, null)]
        [DataRow("http://http", true, "http://http/", true, null)]
        [DataRow("http:", false, null, false, null)]
        [DataRow("http:/", false, null, false, null)]
        [DataRow("http://", false, null, false, null)]
        [DataRow("http://t", true, "http://t/", true, null)]
        [DataRow("http://te", true, "http://te/", true, null)]
        [DataRow("http://tes", true, "http://tes/", true, null)]
        [DataRow("http://test", true, "http://test/", true, null)]
        [DataRow("http://test.", false, null, false, null)]
        [DataRow("http://test.c", true, "http://test.c/", true, null)]
        [DataRow("http://test.co", true, "http://test.co/", true, null)]
        [DataRow("http://test.com", true, "http://test.com/", true, null)]
        [DataRow("http:3", true, "https://http:3/", true, null)]
        [DataRow("http://http:3", true, "http://http:3/", true, null)]
        [DataRow("[::]", true, "https://[::]/", true, null)]
        [DataRow("http://[::]", true, "http://[::]/", true, null)]
        [DataRow("[2001:0DB8::1]", true, "https://[2001:db8::1]/", true, null)]
        [DataRow("http://[2001:0DB8::1]", true, "http://[2001:db8::1]/", true, null)]
        [DataRow("[2001:0DB8::1]:80", true, "http://[2001:db8::1]/", true, null)]
        [DataRow("http://[2001:0DB8::1]:80", true, "http://[2001:db8::1]/", true, null)]
        [DataRow("[2001:0DB8::1]:443", true, "https://[2001:db8::1]/", true, null)]
        [DataRow("http://[2001:0DB8::1]:443", true, "http://[2001:db8::1]:443/", true, null)]
        [DataRow("https://[2001:0DB8::1]:80", true, "https://[2001:db8::1]:80/", true, null)]
        [DataRow("mailto:example@mail.com", true, "mailto:example@mail.com", false, null)]
        [DataRow("ftp://example.com", true, "ftp://example.com/", false, null)]
        [DataRow("ftp://example.com/test", true, "ftp://example.com/test", false, null)]
        [DataRow("ftp://example.com:123/test", true, "ftp://example.com:123/test", false, null)]
        [DataRow("ftp://example.com/126", true, "ftp://example.com/126", false, null)]
        [DataRow("http://test.test.test.test:952", true, "http://test.test.test.test:952/", true, null)]
        [DataRow("https://test.test.test.test:952", true, "https://test.test.test.test:952/", true, null)]

        // Case where `domain:port`, as specified in issue #14260
        // Assumption: Only domain with dot is accepted
        [DataRow("example.com:80", true, "http://example.com/", true, null)]
        [DataRow("example.com:80/test", true, "http://example.com/test", true, null)]
        [DataRow("example.com:80/126", true, "http://example.com/126", true, null)]
        [DataRow("example.com:443", true, "https://example.com/", true, null)]
        [DataRow("example.com:443/test", true, "https://example.com/test", true, null)]
        [DataRow("example.com:443/126", true, "https://example.com/126", true, null)]
        [DataRow("google.com:91", true, "https://google.com:91/", true, null)]
        [DataRow("google.com:91/test", true, "https://google.com:91/test", true, null)]

Review comment (suggestion):
`[::]` is an unspecified address and the same as `0.0.0.0`. These results makes no sense because the adress isn't used anywhere and not assigned to any node.

https://www.heise.de/netze/rfc/rfcs/rfc4291.shtml#page-9

Code after:
        [DataRow("http:", false, null, null)]
        [DataRow("http:/", false, null, null)]
        [DataRow("http://", false, null, null)]
        [DataRow("http://h", true, "http://h/", null)]
        [DataRow("http://ht", true, "http://ht/", null)]
        [DataRow("http://htt", true, "http://htt/", null)]
        [DataRow("http://http", true, "http://http/", null)]
        [DataRow("http://t", true, "http://t/", null)]
        [DataRow("http://te", true, "http://te/", null)]
        [DataRow("http://tes", true, "http://tes/", null)]
        [DataRow("http://test", true, "http://test/", null)]
        [DataRow("http://test.", false, null, null)]
        [DataRow("http://test.c", true, "http://test.c/", null)]
        [DataRow("http://test.co", true, "http://test.co/", null)]
        [DataRow("http://test.com", true, "http://test.com/", null)]
        [DataRow("http:3", true, "https://http:3/", null)]
        [DataRow("http://http:3", true, "http://http:3/", null)]
        [DataRow("[2001:0DB8::1]", true, "https://[2001:db8::1]/", null)]
        [DataRow("[2001:0DB8::1]:80", true, "http://[2001:db8::1]/", null)]
        [DataRow("[2001:0DB8::1]:443", true, "https://[2001:db8::1]/", null)]
        [DataRow("http://[2001:0DB8::1]", true, "http://[2001:db8::1]/", null)]
        [DataRow("http://[2001:0DB8::1]:80", true, "http://[2001:db8::1]/", null)]
        [DataRow("http://[2001:0DB8::1]:443", true, "http://[2001:db8::1]:443/", null)]
        [DataRow("https://[2001:0DB8::1]:80", true, "https://[2001:db8::1]:80/", null)]
        [DataRow("http://test.test.test.test:952", true, "http://test.test.test.test:952/", null)]
        [DataRow("https://test.test.test.test:952", true, "https://test.test.test.test:952/", null)]

        // ToDo: Block [::] address results in parser. This Address is unspecified per RFC 4291 and the results make no sense.
        [DataRow("[::]", true, "https://[::]/", null)]
        [DataRow("http://[::]", true, "http://[::]/", null)]

        // localhost, 127.0.0.1, ::1 tests
        [DataRow("localhost", true, "https://localhost/", null)]
        [DataRow("localhost:80", true, "http://localhost/", null)]
        [DataRow("localhost:443", true, "https://localhost/", null)]
        [DataRow("localhost:1234", true, "https://localhost:1234/", null)]
        [DataRow("localhost/test", true, "https://localhost/test", null)]
        [DataRow("localhost:80/test", true, "http://localhost/test", null)]
        [DataRow("localhost:443/test", true, "https://localhost/test", null)]
        [DataRow("localhost:1234/test", true, "https://localhost:1234/test", null)]
        [DataRow("http://localhost", true, "http://localhost/", null)]
        [DataRow("http://localhost:1234", true, "http://localhost:1234/", null)]
        [DataRow("https://localhost", true, "https://localhost/", null)]
        [DataRow("https://localhost:1234", true, "https://localhost:1234/", null)]
        [DataRow("http://localhost/test", true, "http://localhost/test", null)]
        [DataRow("http://localhost:1234/test", true, "http://localhost:1234/test", null)]
        [DataRow("https://localhost/test", true, "https://localhost/test", null)]
        [DataRow("https://localhost:1234/test", true, "https://localhost:1234/test", null)]
        [DataRow("127.0.0.1", true, "https://127.0.0.1/", null)]
        [DataRow("127.0.0.1:80", true, "http://127.0.0.1/", null)]
        [DataRow("127.0.0.1:443", true, "https://127.0.0.1/", null)]