(files map[string]string)
| 19 | } |
| 20 | |
| 21 | func NewTestFs(files map[string]string) *TestFs { |
| 22 | dirs := map[string]bool{} |
| 23 | for abs := range files { |
| 24 | for d := filepath.ToSlash(filepath.Dir(abs)); !dirs[d]; d = filepath.ToSlash(filepath.Dir(d)) { |
| 25 | dirs[d] = true |
| 26 | fmt.Fprintf(os.Stderr, "testfs: recognized dir: %s\n", d) |
| 27 | } |
| 28 | } |
| 29 | return &TestFs{ |
| 30 | Cwd: "/path/to", |
| 31 | dirs: dirs, |
| 32 | files: files, |
| 33 | |
| 34 | successfulReads: []string{}, |
| 35 | |
| 36 | GlobFixtures: map[string][]string{}, |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | func (f *TestFs) FileExistsAt(path string) bool { |
| 41 | var ok bool |
no outgoing calls