]> Cypherpunks repositories - gostls13.git/commit
testing: make indentation consistent in sub-tests
authorYury Smolsky <yury@smolsky.by>
Tue, 15 May 2018 06:55:46 +0000 (09:55 +0300)
committerMarcel van Lohuizen <mpvl@golang.org>
Thu, 31 May 2018 07:20:38 +0000 (07:20 +0000)
commitfffb3a5c20b31a8d6916697ebac19ac9e8d3f6e7
tree1edb1c75d17ec2d0e2507e627b8fc05b5fb118c6
parent3c4d3bdd3b454ef45ce00559d705fe5dc6f57cad
testing: make indentation consistent in sub-tests

Instead of mixed usage of spaces and tabs for indentation,
just use 4 spaces instead of one tab.

This test:

func TestX(t *testing.T) {
t.Error("1\nnew line")
t.Error("2")
t.Error("3")
t.Run("Y", func(t *testing.T) {
t.Error("2")
t.Error("2b\nnew line")
t.Run("Z", func(t *testing.T) {
t.Error("3\nnew line")
})
})
t.Error("4")
}

produces following output:

--- FAIL: TestX (0.00s)
    indent_test.go:6: 1
new line
    indent_test.go:7: 2
    indent_test.go:8: 3
    --- FAIL: TestX/Y (0.00s)
indent_test.go:10: 2
indent_test.go:11: 2b
    new line
--- FAIL: TestX/Y/Z (0.00s)
    indent_test.go:13: 3
new line
    indent_test.go:16: 4
FAIL

Fixes #25369

Change-Id: Ib3b5da45ab3ee670c6e8a23172e7cbefb94c5e60
Reviewed-on: https://go-review.googlesource.com/113177
Run-TryBot: Yury Smolsky <yury@smolsky.by>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
src/cmd/go/go_test.go
src/testing/sub_test.go
src/testing/testing.go