| 125 | } |
| 126 | |
| 127 | func TestFilesLoadNotExist(t *testing.T) { |
| 128 | Files.Register(".test", &testLoader{}) |
| 129 | |
| 130 | expected := "unable to open resource:" |
| 131 | if err := Files.Load("notExist.test"); err == nil { |
| 132 | t.Error("did not report loading non-existant file as an error") |
| 133 | } else if !strings.HasPrefix(err.Error(), expected) { |
| 134 | t.Errorf("wrong error returned loading non-existant file. want: %v, got: %v", expected, err.Error()) |
| 135 | } |
| 136 | } |
| 137 | |
| 138 | func TestFilesLoadNoFileLoader(t *testing.T) { |
| 139 | expected := "no `FileLoader` associated with this extension:" |