From 53f26d7d04a38db0a5ce8b2c5c8cfe819ca148ac Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Fri, 11 Mar 2022 12:03:18 +1100 Subject: [PATCH] Test that empty info names are ignored in multi-file torrent webseed URLs --- webseed/request_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/webseed/request_test.go b/webseed/request_test.go index b82a0057..f7c18a03 100644 --- a/webseed/request_test.go +++ b/webseed/request_test.go @@ -21,3 +21,9 @@ func TestTrailingPath(t *testing.T) { "a_1-b_c2/d 3. (e, f).g", ) } + +func TestTrailingPathForEmptyInfoName(t *testing.T) { + qt.Check(t, trailingPath("", []string{`ノ┬─┬ノ ︵ ( \o°o)\`}), qt.Equals, "%E3%83%8E%E2%94%AC%E2%94%80%E2%94%AC%E3%83%8E+%EF%B8%B5+%28+%5Co%C2%B0o%29%5C") + qt.Check(t, trailingPath("", []string{"hello", "world"}), qt.Equals, "hello/world") + qt.Check(t, trailingPath("war", []string{"and", "peace"}), qt.Equals, "war/and/peace") +}