Black Lives Matter. Support the Equal Justice Initiative.

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

Documentation: cmd/go/testdata/script

     1  [short] skip
     2  go test -cover ./pkg1 ./pkg2 ./pkg3 ./pkg4
     3  stdout 'pkg1	\[no test files\]'
     4  stdout 'pkg2	\S+	coverage: 0.0% of statements \[no tests to run\]'
     5  stdout 'pkg3	\S+	coverage: 100.0% of statements'
     6  stdout 'pkg4	\S+	coverage: \[no statements\]'
     7  
     8  -- go.mod --
     9  module m
    10  
    11  go 1.16
    12  -- pkg1/a.go --
    13  package pkg1
    14  
    15  import "fmt"
    16  
    17  func F() {
    18  	fmt.Println("pkg1")
    19  }
    20  -- pkg2/a.go --
    21  package pkg2
    22  
    23  import "fmt"
    24  
    25  func F() {
    26  	fmt.Println("pkg2")
    27  }
    28  -- pkg2/a_test.go --
    29  package pkg2
    30  -- pkg3/a.go --
    31  package pkg3
    32  
    33  import "fmt"
    34  
    35  func F() {
    36  	fmt.Println("pkg3")
    37  }
    38  -- pkg3/a_test.go --
    39  package pkg3
    40  
    41  import "testing"
    42  
    43  func TestF(t *testing.T) {
    44  	F()
    45  }
    46  -- pkg4/a.go --
    47  package pkg4
    48  
    49  type T struct {
    50  	X bool
    51  }
    52  -- pkg4/a_test.go --
    53  package pkg4
    54  
    55  import (
    56  	"testing"
    57  )
    58  
    59  func TestT(t *testing.T) {
    60  	_ = T{}
    61  }
    62  

View as plain text