aboutsummaryrefslogtreecommitdiff
path: root/internal/stdlib/stdlib_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/stdlib/stdlib_test.go')
-rw-r--r--internal/stdlib/stdlib_test.go18
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)
+ }
+ }
+}