Skip to content

testing: test output indentation looks inconsistent when tab width != 4 #25369

@dpinela

Description

@dpinela

What did you do?

Run the following program:
https://play.golang.org/p/IAMobZmXMqw

What did you expect to see?

=== RUN   TestX
=== RUN   TestX/Y
=== RUN   TestX/Y/Z
--- FAIL: TestX (0.00s)
    main.go:6: 1
    --- FAIL: TestX/Y (0.00s)
        main.go:8: 2
        --- FAIL: TestX/Y/Z (0.00s)
            main.go:10: 3
    main.go:13: 4
FAIL

This is what you see if tabs are 4 spaces wide. Note that each subtest's output is indented with 4 leading spaces, and each log message has a tab after those.

What did you see instead?

=== RUN   TestX
=== RUN   TestX/Y
=== RUN   TestX/Y/Z
--- FAIL: TestX (0.00s)
        main.go:6: 1
    --- FAIL: TestX/Y (0.00s)
        main.go:8: 2
        --- FAIL: TestX/Y/Z (0.00s)
                main.go:10: 3
        main.go:13: 4
FAIL

This is what you see if tabs are 8 spaces wide; any tab width other than 4 will cause similar inconsistencies.

System details

go version go1.10.2 darwin/amd64
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/dpinela/Library/Caches/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/dpinela/dev/go"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.10.2/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.10.2/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/41/2xpv_r1j5n5bnflwb7s1hv580000gp/T/go-build030076165=/tmp/go-build -gno-record-gcc-switches -fno-common"
GOROOT/bin/go version: go version go1.10.2 darwin/amd64
GOROOT/bin/go tool compile -V: compile version go1.10.2
uname -v: Darwin Kernel Version 17.5.0: Fri Apr 13 19:32:32 PDT 2018; root:xnu-4570.51.2~1/RELEASE_X86_64
ProductName:	Mac OS X
ProductVersion:	10.13.4
BuildVersion:	17E202
lldb --version: lldb-902.0.79.2
  Swift-4.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions