Text file src/cmd/go/testdata/script/list_test_cycle.txt

     1  go list ./p
     2  stdout 'example/p'
     3  
     4  ! go list -json=ImportPath -test ./p
     5  cmp stderr wanterr.txt
     6  
     7  ! go list -json=ImportPath,Deps -test ./p
     8  cmp stderr wanterr.txt
     9  
    10  ! go list -json=ImportPath,Deps -deps -test ./p
    11  cmp stderr wanterr.txt
    12  
    13  ! go list -json=ImportPath -deps -test ./p
    14  cmp stderr wanterr.txt
    15  
    16  -- wanterr.txt --
    17  go: can't load test package: package example/p
    18  	imports example/q
    19  	imports example/r
    20  	imports example/p: import cycle not allowed in test
    21  -- go.mod --
    22  module example
    23  go 1.20
    24  -- p/p.go --
    25  package p
    26  -- p/p_test.go --
    27  package p
    28  import "example/q"
    29  -- q/q.go --
    30  package q
    31  import "example/r"
    32  -- r/r.go --
    33  package r
    34  import "example/p"
    35  

View as plain text