diff options
author | Sören Tempel <soeren+git@soeren-tempel.net> | 2018-10-15 21:04:33 +0200 |
---|---|---|
committer | Sören Tempel <soeren+git@soeren-tempel.net> | 2018-10-15 21:04:33 +0200 |
commit | 0d8a6942ac6996a4c31ea4180e21f5d5706e929a (patch) | |
tree | 72ec31061632792874f29f04943d10a0a10eef71 /community/rest-server/0001-Move-TestIsUserPath-to-correct-package.patch | |
parent | 28150adaf85ebb64ea4668c5fa3e5658e46058e7 (diff) | |
download | aports-0d8a6942ac6996a4c31ea4180e21f5d5706e929a.tar.bz2 aports-0d8a6942ac6996a4c31ea4180e21f5d5706e929a.tar.xz |
community/rest-server: move from testing
Diffstat (limited to 'community/rest-server/0001-Move-TestIsUserPath-to-correct-package.patch')
-rw-r--r-- | community/rest-server/0001-Move-TestIsUserPath-to-correct-package.patch | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/community/rest-server/0001-Move-TestIsUserPath-to-correct-package.patch b/community/rest-server/0001-Move-TestIsUserPath-to-correct-package.patch new file mode 100644 index 0000000000..5c3932f849 --- /dev/null +++ b/community/rest-server/0001-Move-TestIsUserPath-to-correct-package.patch @@ -0,0 +1,71 @@ +From 69ed06aa661590ae74e4e839f71f6861d5fb4243 Mon Sep 17 00:00:00 2001 +From: Alexander Neumann <alexander@bumpern.de> +Date: Tue, 20 Mar 2018 20:45:59 +0100 +Subject: [PATCH] Move TestIsUserPath to correct package + +--- + cmd/rest-server/main_test.go | 21 --------------------- + handlers_test.go | 21 +++++++++++++++++++++ + 2 files changed, 21 insertions(+), 21 deletions(-) + +diff --git a/cmd/rest-server/main_test.go b/cmd/rest-server/main_test.go +index 44b06a2..b2a71e1 100644 +--- a/cmd/rest-server/main_test.go ++++ b/cmd/rest-server/main_test.go +@@ -71,24 +71,3 @@ func TestTLSSettings(t *testing.T) { + }) + } + } +- +-func TestIsUserPath(t *testing.T) { +- var tests = []struct { +- username string +- path string +- result bool +- }{ +- {"foo", "/", false}, +- {"foo", "/foo", true}, +- {"foo", "/foo/", true}, +- {"foo", "/foo/bar", true}, +- {"foo", "/foobar", false}, +- } +- +- for _, test := range tests { +- result := isUserPath(test.username, test.path) +- if result != test.result { +- t.Errorf("isUserPath(%q, %q) was incorrect, got: %v, want: %v.", test.username, test.path, result, test.result) +- } +- } +-} +diff --git a/handlers_test.go b/handlers_test.go +index 6536a26..f6cdbaa 100644 +--- a/handlers_test.go ++++ b/handlers_test.go +@@ -37,3 +37,24 @@ func TestJoin(t *testing.T) { + }) + } + } ++ ++func TestIsUserPath(t *testing.T) { ++ var tests = []struct { ++ username string ++ path string ++ result bool ++ }{ ++ {"foo", "/", false}, ++ {"foo", "/foo", true}, ++ {"foo", "/foo/", true}, ++ {"foo", "/foo/bar", true}, ++ {"foo", "/foobar", false}, ++ } ++ ++ for _, test := range tests { ++ result := isUserPath(test.username, test.path) ++ if result != test.result { ++ t.Errorf("isUserPath(%q, %q) was incorrect, got: %v, want: %v.", test.username, test.path, result, test.result) ++ } ++ } ++} +-- +2.18.0 + |