lib/fs: Consolidate append in test

This commit is contained in:
Jakob Borg 2022-07-28 19:05:24 +02:00
parent 966db0d076
commit 212258d213

View File

@ -455,27 +455,29 @@ func TestRooted(t *testing.T) {
} }
for _, tc := range cases { for _, tc := range cases {
extraCases = append(extraCases,
// Add case where root is backslashed, rel is forward slashed // Add case where root is backslashed, rel is forward slashed
extraCases = append(extraCases, testcase{ testcase{
root: filepath.FromSlash(tc.root), root: filepath.FromSlash(tc.root),
rel: tc.rel, rel: tc.rel,
joined: tc.joined, joined: tc.joined,
ok: tc.ok, ok: tc.ok,
}) },
// and the opposite // and the opposite
extraCases = append(extraCases, testcase{ testcase{
root: tc.root, root: tc.root,
rel: filepath.FromSlash(tc.rel), rel: filepath.FromSlash(tc.rel),
joined: tc.joined, joined: tc.joined,
ok: tc.ok, ok: tc.ok,
}) },
// and both backslashed // and both backslashed
extraCases = append(extraCases, testcase{ testcase{
root: filepath.FromSlash(tc.root), root: filepath.FromSlash(tc.root),
rel: filepath.FromSlash(tc.rel), rel: filepath.FromSlash(tc.rel),
joined: tc.joined, joined: tc.joined,
ok: tc.ok, ok: tc.ok,
}) },
)
} }
cases = append(cases, extraCases...) cases = append(cases, extraCases...)