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

     1  [short] skip
     2  
     3  go test xtestonly
     4  ! stdout '^ok.*\[no tests to run\]'
     5  stdout '^ok'
     6  
     7  -- go.mod --
     8  module xtestonly
     9  
    10  go 1.16
    11  -- f.go --
    12  package xtestonly
    13  
    14  func F() int { return 42 }
    15  -- f_test.go --
    16  package xtestonly_test
    17  
    18  import (
    19  	"testing"
    20  	"xtestonly"
    21  )
    22  
    23  func TestF(t *testing.T) {
    24  	if x := xtestonly.F(); x != 42 {
    25  		t.Errorf("f.F() = %d, want 42", x)
    26  	}
    27  }
    28  

View as plain text