| Server IP : 217.160.0.212 / Your IP : 216.73.217.70 Web Server : Apache System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64 User : sws1073854427 ( 1073854427) PHP Version : 8.4.23 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /lib/go/src/cmd/go/testdata/script/ |
Upload File : |
[short] skip
# collect coverage profile in text format
go test -coverprofile=blah.prof prog.go prog_test.go
# should not contain cmd-line pseudo-import-path
grep prog.go blah.prof
grep $PWD blah.prof
! grep command-line-arguments blah.prof
-- prog.go --
package main
func Mumble(x int) int {
if x < 0 {
return -x
}
return 42
}
func Grumble(y int) int {
return -y
}
func main() {
}
-- prog_test.go --
package main
import (
"testing"
)
func TestMumble(t *testing.T) {
if x := Mumble(10); x != 42 {
t.Errorf("Mumble(%d): got %d want %d", 10, x, 42)
}
}