Skip to content

testscript: invalid escape sequence when parsing argument to stdout #255

@myitcv

Description

@myitcv

As of c8567cf , the following (which can be used as a testscript test for testscript itself) fails when it should succeed:

env BLAH='\'
exec echo ..${BLAH}LICENSE
stdout ..${BLAH}LICENSE

The output is:

--- FAIL: TestScripts (0.00s)
    --- FAIL: TestScripts/stdout (0.00s)
        testscript.go:558: > env BLAH='\'
            > exec echo ..${BLAH}LICENSE
            [stdout]
            ..\LICENSE
            > stdout ..${BLAH}LICENSE
            FAIL: testdata/stdout.txt:3: error parsing regexp: invalid escape sequence: `\L`

FAIL
FAIL    github.com/rogpeppe/go-internal/testscript      1.857s

Upstream Go succeeds with this test (as of golang/go@9b43bfb).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions