(t *testing.T)
| 33 | } |
| 34 | |
| 35 | func TestParseFallback(t *testing.T) { |
| 36 | fallbackTests := []string{ |
| 37 | "dir1/dir2", |
| 38 | "/dir1/dir2", |
| 39 | "/dir1:foobar/dir2", |
| 40 | `\dir1\foobar\dir2`, |
| 41 | `c:\dir1\foobar\dir2`, |
| 42 | `C:\Users\appveyor\AppData\Local\Temp\1\restic-test-879453535\repo`, |
| 43 | `c:/dir1/foobar/dir2`, |
| 44 | } |
| 45 | |
| 46 | registry := location.NewRegistry() |
| 47 | registry.Register(testFactory()) |
| 48 | |
| 49 | for _, path := range fallbackTests { |
| 50 | t.Run(path, func(t *testing.T) { |
| 51 | u, err := location.Parse(registry, path) |
| 52 | if err != nil { |
| 53 | t.Fatalf("unexpected error: %v", err) |
| 54 | } |
| 55 | test.Equals(t, "local", u.Scheme) |
| 56 | test.Equals(t, "local:"+path, u.Config.(*testConfig).loc) |
| 57 | }) |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | func TestInvalidScheme(t *testing.T) { |
| 62 | registry := location.NewRegistry() |
nothing calls this directly
no test coverage detected