1 // Copyright 2016 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
5 package gcexportdata_test
14 "golang.org/x/tools/go/gcexportdata"
17 // Test to ensure that gcexportdata can read files produced by App
18 // Engine Go runtime v1.6.
19 func TestAppEngine16(t *testing.T) {
20 // Open and read the file.
21 f, err := os.Open("testdata/errors-ae16.a")
26 r, err := gcexportdata.NewReader(f)
28 log.Fatalf("reading export data: %v", err)
31 // Decode the export data.
32 fset := token.NewFileSet()
33 imports := make(map[string]*types.Package)
34 pkg, err := gcexportdata.Read(r, fset, imports, "errors")
39 // Print package information.
40 got := pkg.Scope().Lookup("New").Type().String()
41 want := "func(text string) error"
43 t.Errorf("New.Type = %s, want %s", got, want)