MCPcopy Index your code
hub / github.com/maruel/panicparse / TestIsGomodule

Function TestIsGomodule

stack/context_test.go:2107–2127  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

2105}
2106
2107func 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
2129func TestAtou(t *testing.T) {
2130 t.Parallel()

Callers

nothing calls this directly

Calls 2

isGoModuleMethod · 0.95
splitPathFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…