...
1
2
3
4
5
6
7
8 package interp_test
9
10 import (
11 "log"
12 "os"
13 "path/filepath"
14 "testing"
15
16 "golang.org/x/tools/internal/testenv"
17 )
18
19 func init() {
20 testdataTests = append(testdataTests,
21 "rangevarlifetime_go122.go",
22 "forvarlifetime_go122.go",
23 )
24 }
25
26
27 func TestExperimentRange(t *testing.T) {
28 testenv.NeedsGoExperiment(t, "range")
29
30
31 goroot := makeGoroot(t)
32 cwd, err := os.Getwd()
33 if err != nil {
34 log.Fatal(err)
35 }
36 run(t, filepath.Join(cwd, "testdata", "rangeoverint.go"), goroot)
37 }
38
View as plain text