From 212258d213330fc0a7c3f14ddaf577411930f88d Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Thu, 28 Jul 2022 19:05:24 +0200 Subject: [PATCH] lib/fs: Consolidate append in test --- lib/fs/basicfs_test.go | 44 ++++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/lib/fs/basicfs_test.go b/lib/fs/basicfs_test.go index 261167f79..6a1774f87 100644 --- a/lib/fs/basicfs_test.go +++ b/lib/fs/basicfs_test.go @@ -455,27 +455,29 @@ func TestRooted(t *testing.T) { } for _, tc := range cases { - // Add case where root is backslashed, rel is forward slashed - extraCases = append(extraCases, testcase{ - root: filepath.FromSlash(tc.root), - rel: tc.rel, - joined: tc.joined, - ok: tc.ok, - }) - // and the opposite - extraCases = append(extraCases, testcase{ - root: tc.root, - rel: filepath.FromSlash(tc.rel), - joined: tc.joined, - ok: tc.ok, - }) - // and both backslashed - extraCases = append(extraCases, testcase{ - root: filepath.FromSlash(tc.root), - rel: filepath.FromSlash(tc.rel), - joined: tc.joined, - ok: tc.ok, - }) + extraCases = append(extraCases, + // Add case where root is backslashed, rel is forward slashed + testcase{ + root: filepath.FromSlash(tc.root), + rel: tc.rel, + joined: tc.joined, + ok: tc.ok, + }, + // and the opposite + testcase{ + root: tc.root, + rel: filepath.FromSlash(tc.rel), + joined: tc.joined, + ok: tc.ok, + }, + // and both backslashed + testcase{ + root: filepath.FromSlash(tc.root), + rel: filepath.FromSlash(tc.rel), + joined: tc.joined, + ok: tc.ok, + }, + ) } cases = append(cases, extraCases...)