mirror of
https://github.com/octoleo/syncthing.git
synced 2025-01-03 15:17:25 +00:00
lib/fs: Consolidate append in test
This commit is contained in:
parent
966db0d076
commit
212258d213
@ -455,27 +455,29 @@ func TestRooted(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, tc := range cases {
|
for _, tc := range cases {
|
||||||
// Add case where root is backslashed, rel is forward slashed
|
extraCases = append(extraCases,
|
||||||
extraCases = append(extraCases, testcase{
|
// Add case where root is backslashed, rel is forward slashed
|
||||||
root: filepath.FromSlash(tc.root),
|
testcase{
|
||||||
rel: tc.rel,
|
root: filepath.FromSlash(tc.root),
|
||||||
joined: tc.joined,
|
rel: tc.rel,
|
||||||
ok: tc.ok,
|
joined: tc.joined,
|
||||||
})
|
ok: tc.ok,
|
||||||
// and the opposite
|
},
|
||||||
extraCases = append(extraCases, testcase{
|
// and the opposite
|
||||||
root: tc.root,
|
testcase{
|
||||||
rel: filepath.FromSlash(tc.rel),
|
root: tc.root,
|
||||||
joined: tc.joined,
|
rel: filepath.FromSlash(tc.rel),
|
||||||
ok: tc.ok,
|
joined: tc.joined,
|
||||||
})
|
ok: tc.ok,
|
||||||
// and both backslashed
|
},
|
||||||
extraCases = append(extraCases, testcase{
|
// and both backslashed
|
||||||
root: filepath.FromSlash(tc.root),
|
testcase{
|
||||||
rel: filepath.FromSlash(tc.rel),
|
root: filepath.FromSlash(tc.root),
|
||||||
joined: tc.joined,
|
rel: filepath.FromSlash(tc.rel),
|
||||||
ok: tc.ok,
|
joined: tc.joined,
|
||||||
})
|
ok: tc.ok,
|
||||||
|
},
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
cases = append(cases, extraCases...)
|
cases = append(cases, extraCases...)
|
||||||
|
Loading…
Reference in New Issue
Block a user