Compare commits
1
Commits
next
..
a97277c534
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a97277c534 |
No files matched your search
@@ -1,7 +1,6 @@
|
|||||||
package dcf
|
package dcf
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
|
||||||
"errors"
|
"errors"
|
||||||
"io/fs"
|
"io/fs"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
@@ -60,20 +59,6 @@ func TestParseStoresReturnsErrorNamingTheCard(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestParseStoresReturnsErrorWhenCancelled(t *testing.T) {
|
|
||||||
t.Parallel()
|
|
||||||
|
|
||||||
ctx, cancel := context.WithCancel(t.Context())
|
|
||||||
cancel()
|
|
||||||
|
|
||||||
mountpoint := newCardOnDisk(t, "DCIM/100ABCDE/ABCD0001.JPG")
|
|
||||||
|
|
||||||
_, err := parseStores(ctx, []string{mountpoint})
|
|
||||||
if !errors.Is(err, context.Canceled) {
|
|
||||||
t.Fatalf("parseStores error = %v, want %v", err, context.Canceled)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestOnlyStore(t *testing.T) {
|
func TestOnlyStore(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
|
|||||||
@@ -891,16 +891,9 @@ func TestParseStoreReadsNoDirectoryWhenAlreadyCancelled(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, card := range cards {
|
for _, card := range cards {
|
||||||
var read []string
|
_, err := parseStore(ctx, card, testRoot)
|
||||||
|
|
||||||
// The context is already cancelled, so this needs no name to cancel at.
|
|
||||||
fsys := cancelingFS{MapFS: card, read: &read}
|
|
||||||
|
|
||||||
_, err := parseStore(ctx, fsys, testRoot)
|
|
||||||
if !errors.Is(err, context.Canceled) {
|
if !errors.Is(err, context.Canceled) {
|
||||||
t.Errorf("error = %v, want %v", err, context.Canceled)
|
t.Errorf("error = %v, want %v", err, context.Canceled)
|
||||||
}
|
}
|
||||||
|
|
||||||
assertPaths(t, "directories read", read)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user