(t *testing.T)
| 2105 | } |
| 2106 | |
| 2107 | func TestIsGomodule(t *testing.T) { |
| 2108 | t.Parallel() |
| 2109 | pwd, err := os.Getwd() |
| 2110 | if err != nil { |
| 2111 | t.Fatal(err) |
| 2112 | } |
| 2113 | // Our internal functions work with '/' as path separator. |
| 2114 | parts := splitPath(strings.Replace(pwd, "\\", "/", -1)) |
| 2115 | gmc := gomodCache{} |
| 2116 | root, importPath := gmc.isGoModule(parts) |
| 2117 | if want := strings.Join(parts[:len(parts)-1], "/"); want != root { |
| 2118 | t.Errorf("want: %q, got: %q", want, root) |
| 2119 | } |
| 2120 | if want := "github.com/maruel/panicparse/v2"; want != importPath { |
| 2121 | t.Errorf("want: %q, got: %q", want, importPath) |
| 2122 | } |
| 2123 | got := reModule.FindStringSubmatch("foo\r\nmodule bar\r\nbaz") |
| 2124 | if diff := cmp.Diff([]string{"module bar\r", "bar"}, got); diff != "" { |
| 2125 | t.Fatalf("-want, +got:\n%s", diff) |
| 2126 | } |
| 2127 | } |
| 2128 | |
| 2129 | func TestAtou(t *testing.T) { |
| 2130 | t.Parallel() |
nothing calls this directly
no test coverage detected
searching dependent graphs…