-
Notifications
You must be signed in to change notification settings - Fork 1
/
builtin_test.go
38 lines (31 loc) · 679 Bytes
/
builtin_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package gollect
/*
This test is used for only confirmation when the Go version changes.
Packages differ depending on the environment, but we ignore it
because they are not so important in competition programming.
*/
/*
import (
"reflect"
"strings"
"testing"
"golang.org/x/tools/go/packages"
)
func TestIsBuiltin(t *testing.T) {
pkgs, err := packages.Load(nil, "std")
if err != nil {
panic(err)
}
m := make(map[string]interface{})
for _, pkg := range pkgs {
p := pkg.PkgPath
if !strings.Contains(p, "internal/") {
m[pkg.PkgPath] = struct{}{}
}
}
eq := reflect.DeepEqual(m, builtinPackages)
if !eq {
t.Error("please update builtinPackages")
}
}
*/