diff options
| author | Jonathan Amsterdam <jba@google.com> | 2019-11-11 16:22:26 -0500 |
|---|---|---|
| committer | Julie Qiu <julie@golang.org> | 2020-03-27 16:46:47 -0400 |
| commit | 355b026adf25658be4978470eb851cb27eb30a3f (patch) | |
| tree | 1ad19c5761ed018700382de645017250716165d4 /internal/stdlib/stdlib_test.go | |
| parent | 8f7732c9ce43eafff92a3395e86ee9bf0264a1aa (diff) | |
| download | go-x-pkgsite-355b026adf25658be4978470eb851cb27eb30a3f.tar.xz | |
internal/postgres: ignore self-imports in imported-by counts
Do not count package A as importing package B if they
are in the same module.
Change-Id: Ic0f98af8d72b8fff29e105779c6eb619214335e9
Reviewed-on: https://team-review.git.corp.google.com/c/golang/discovery/+/596525
CI-Result: Cloud Build <devtools-proctor-result-processor@system.gserviceaccount.com>
Reviewed-by: Julie Qiu <julieqiu@google.com>
Diffstat (limited to 'internal/stdlib/stdlib_test.go')
| -rw-r--r-- | internal/stdlib/stdlib_test.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/internal/stdlib/stdlib_test.go b/internal/stdlib/stdlib_test.go index eca3760d..a0116100 100644 --- a/internal/stdlib/stdlib_test.go +++ b/internal/stdlib/stdlib_test.go @@ -189,3 +189,21 @@ func TestVersionForTag(t *testing.T) { } } } + +func TestContains(t *testing.T) { + for _, test := range []struct { + in string + want bool + }{ + {"fmt", true}, + {"encoding/json", true}, + {"something/with.dots", true}, + {"example.com", false}, + {"example.com/fmt", false}, + } { + got := Contains(test.in) + if got != test.want { + t.Errorf("Contains(%q) = %t, want %t", test.in, got, test.want) + } + } +} |
