Skip to content

Commit bd88e39

Browse files
author
Andrew Hall
committed
Use collection expressions
1 parent 9c1bfd6 commit bd88e39

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/Utilities/UrlDecoderTests.cs

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,23 @@ namespace Microsoft.CodeAnalysis.Razor.Workspaces.Test.Utilities;
1212
public class UrlDecoderTests(ITestOutputHelper testOutput) : ToolingTestBase(testOutput)
1313
{
1414
public static IEnumerable<object[]> UrlDecodeData =>
15-
new[]
16-
{
17-
new object[] { "http://127.0.0.1:8080/appDir/page.aspx?foo=bar", "http://127.0.0.1:8080/appDir/page.aspx?foo=b%61r" },
18-
new object[] { "http://127.0.0.1:8080/appDir/page.aspx?foo=b%ar", "http://127.0.0.1:8080/appDir/page.aspx?foo=b%%61r" },
19-
new object[] { "http://127.0.0.1:8080/app%Dir/page.aspx?foo=b%ar", "http://127.0.0.1:8080/app%Dir/page.aspx?foo=b%%61r" },
20-
new object[] { "http://127.0.0.1:8080/app%%Dir/page.aspx?foo=b%%r", "http://127.0.0.1:8080/app%%Dir/page.aspx?foo=b%%r" },
21-
new object[] { "http://127.0.0.1:8080/appDir/page.aspx?foo=ba%r", "http://127.0.0.1:8080/appDir/page.aspx?foo=b%61%r" },
22-
new object[] { "http://127.0.0.1:8080/appDir/page.aspx?foo=bar baz", "http://127.0.0.1:8080/appDir/page.aspx?foo=bar+baz" },
23-
new object[] { "http://example.net/\U00010000", "http://example.net/\U00010000" },
24-
new object[] { "http://example.net/\uD800", "http://example.net/\uD800" },
25-
new object[] { "http://example.net/\uD800a", "http://example.net/\uD800a" },
15+
[
16+
["http://127.0.0.1:8080/appDir/page.aspx?foo=bar", "http://127.0.0.1:8080/appDir/page.aspx?foo=b%61r"],
17+
["http://127.0.0.1:8080/appDir/page.aspx?foo=b%ar", "http://127.0.0.1:8080/appDir/page.aspx?foo=b%%61r"],
18+
["http://127.0.0.1:8080/app%Dir/page.aspx?foo=b%ar", "http://127.0.0.1:8080/app%Dir/page.aspx?foo=b%%61r"],
19+
["http://127.0.0.1:8080/app%%Dir/page.aspx?foo=b%%r", "http://127.0.0.1:8080/app%%Dir/page.aspx?foo=b%%r"],
20+
["http://127.0.0.1:8080/appDir/page.aspx?foo=ba%r", "http://127.0.0.1:8080/appDir/page.aspx?foo=b%61%r"],
21+
["http://127.0.0.1:8080/appDir/page.aspx?foo=bar baz", "http://127.0.0.1:8080/appDir/page.aspx?foo=bar+baz"],
22+
["http://example.net/\U00010000", "http://example.net/\U00010000"],
23+
["http://example.net/\uD800", "http://example.net/\uD800"],
24+
["http://example.net/\uD800a", "http://example.net/\uD800a"],
2625
// The "Baz" portion of "http://example.net/Baz" has been double-encoded - one iteration of UrlDecode() should produce a once-encoded string.
27-
new object[] { "http://example.net/%6A%6B%6C", "http://example.net/%256A%256B%256C"},
26+
["http://example.net/%6A%6B%6C", "http://example.net/%256A%256B%256C"],
2827
// The second iteration should return the original string
29-
new object[] { "http://example.net/jkl", "http://example.net/%6A%6B%6C"},
28+
["http://example.net/jkl", "http://example.net/%6A%6B%6C"],
3029
// This example uses lowercase hex characters
31-
new object[] { "http://example.net/jkl", "http://example.net/%6a%6b%6c"}
32-
};
30+
["http://example.net/jkl", "http://example.net/%6a%6b%6c"]
31+
];
3332

3433
[Theory]
3534
[MemberData(nameof(UrlDecodeData))]

0 commit comments

Comments
 (0)