From: Simon Ruderich Date: Thu, 1 Aug 2019 21:06:56 +0000 (+0200) Subject: nsscash: main_test: refactor in preparation for HTTPS X-Git-Tag: 0.1~31 X-Git-Url: https://ruderich.org/simon/gitweb/?a=commitdiff_plain;h=1b9065b13eeeb40ecf6759bb065f0a039d2a9996;p=nsscash%2Fnsscash.git nsscash: main_test: refactor in preparation for HTTPS --- diff --git a/main_test.go b/main_test.go index 4786565..ab5e9b7 100644 --- a/main_test.go +++ b/main_test.go @@ -207,6 +207,12 @@ func TestMainFetch(t *testing.T) { fetchSecondFetchFails, } + for _, f := range tests { + runMainTest(t, f) + } +} + +func runMainTest(t *testing.T, f func(args)) { cleanup := []string{ configPath, statePath, @@ -215,7 +221,6 @@ func TestMainFetch(t *testing.T) { groupPath, } - for _, f := range tests { // NOTE: This is not guaranteed to work according to reflect's // documentation but seems to work reliable for normal // functions. @@ -248,7 +253,6 @@ func TestMainFetch(t *testing.T) { handler: &handler, }) }) - } } func fetchPasswdCacheFileDoesNotExist(a args) {