| 1 | //go:build windows |
| 2 | |
| 3 | package main |
| 4 | |
| 5 | import ( |
| 6 | "strings" |
| 7 | "testing" |
| 8 | ) |
| 9 | |
| 10 | func TestNormalizeLocalOpenPathRejectsDriveLessWindowsFileURL(t *testing.T) { |
| 11 | for _, value := range []string{"file:///report.md", "file:///dir/report.md"} { |
| 12 | if got, err := normalizeLocalOpenPath(value); err == nil || !strings.Contains(err.Error(), "not absolute") { |
| 13 | t.Errorf("normalizeLocalOpenPath(%q) = (%q, %v), want not-absolute error", value, got, err) |
| 14 | } |
| 15 | } |
| 16 | } |
| 17 |