| 136 | } |
| 137 | |
| 138 | func TestFilesLoadNoFileLoader(t *testing.T) { |
| 139 | expected := "no `FileLoader` associated with this extension:" |
| 140 | if err := Files.Load("test.wrongExtension"); err == nil { |
| 141 | t.Error("did not report loading file without an associated file loader") |
| 142 | } else if !strings.HasPrefix(err.Error(), expected) { |
| 143 | t.Errorf("wrong error returned loading file without an associated file loader. want: %v, got %v", expected, err.Error()) |
| 144 | } |
| 145 | } |
| 146 | |
| 147 | func TestFilesLoadReaderData(t *testing.T) { |
| 148 | Files.Register(".test", &testLoader{}) |