Test that WithDataFS refuses a nil module and a manifest's reads refuses a repeated module
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package fejkdata
|
||||
|
||||
import (
|
||||
"io/fs"
|
||||
"reflect"
|
||||
"slices"
|
||||
"strings"
|
||||
@@ -134,6 +135,13 @@ func TestWithDataFSLayersEachModuleOverTheOneBefore(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestWithDataFSRefusesANilModule(t *testing.T) {
|
||||
var unset fs.FS
|
||||
if _, err := New(WithDataFS(fstest.MapFS{}, unset)); err == nil || !strings.Contains(err.Error(), "WithDataFS module 2 is nil") {
|
||||
t.Errorf("New(WithDataFS(fsys, nil)) = %v, want module 2 named nil", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestFakeIsSafeForConcurrentUse(t *testing.T) {
|
||||
f, err := New(withShipped(), WithSeed(1))
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user