Skip to content

TestMatches Test failing with Golang 1.16-beta1 #41953

@olivierlemasle

Description

@olivierlemasle

Description

Test TestMatches in ./pkg/fileutils/ is failing with Go 1.16-beta1.
It works correctly with Go <= 1.15

Steps to reproduce the issue:

go test -v ./pkg/fileutils/

Describe the results you received:

=== RUN   TestCopyFileWithInvalidSrc
--- PASS: TestCopyFileWithInvalidSrc (0.00s)
=== RUN   TestCopyFileWithInvalidDest
--- PASS: TestCopyFileWithInvalidDest (0.00s)
=== RUN   TestCopyFileWithSameSrcAndDest
--- PASS: TestCopyFileWithSameSrcAndDest (0.00s)
=== RUN   TestCopyFileWithSameSrcAndDestWithPathNameDifferent
--- PASS: TestCopyFileWithSameSrcAndDestWithPathNameDifferent (0.00s)
=== RUN   TestCopyFile
--- PASS: TestCopyFile (0.00s)
=== RUN   TestReadSymlinkedDirectoryExistingDirectory
--- PASS: TestReadSymlinkedDirectoryExistingDirectory (0.00s)
=== RUN   TestReadSymlinkedDirectoryNonExistingSymlink
--- PASS: TestReadSymlinkedDirectoryNonExistingSymlink (0.00s)
=== RUN   TestReadSymlinkedDirectoryToFile
--- PASS: TestReadSymlinkedDirectoryToFile (0.00s)
=== RUN   TestWildcardMatches
--- PASS: TestWildcardMatches (0.00s)
=== RUN   TestPatternMatches
--- PASS: TestPatternMatches (0.00s)
=== RUN   TestExclusionPatternMatchesPatternBefore
--- PASS: TestExclusionPatternMatchesPatternBefore (0.00s)
=== RUN   TestPatternMatchesFolderExclusions
--- PASS: TestPatternMatchesFolderExclusions (0.00s)
=== RUN   TestPatternMatchesFolderWithSlashExclusions
--- PASS: TestPatternMatchesFolderWithSlashExclusions (0.00s)
=== RUN   TestPatternMatchesFolderWildcardExclusions
--- PASS: TestPatternMatchesFolderWildcardExclusions (0.00s)
=== RUN   TestExclusionPatternMatchesPatternAfter
--- PASS: TestExclusionPatternMatchesPatternAfter (0.00s)
=== RUN   TestExclusionPatternMatchesWholeDirectory
--- PASS: TestExclusionPatternMatchesWholeDirectory (0.00s)
=== RUN   TestSingleExclamationError
--- PASS: TestSingleExclamationError (0.00s)
=== RUN   TestMatchesWithNoPatterns
--- PASS: TestMatchesWithNoPatterns (0.00s)
=== RUN   TestMatchesWithMalformedPatterns
--- PASS: TestMatchesWithMalformedPatterns (0.00s)
=== RUN   TestMatches
    fileutils_test.go:387: assertion failed: error is not nil: syntax error in pattern: pattern="a\\" text="a\\"
--- FAIL: TestMatches (0.00s)
=== RUN   TestCleanPatterns
--- PASS: TestCleanPatterns (0.00s)
=== RUN   TestCleanPatternsStripEmptyPatterns
--- PASS: TestCleanPatternsStripEmptyPatterns (0.00s)
=== RUN   TestCleanPatternsExceptionFlag
--- PASS: TestCleanPatternsExceptionFlag (0.00s)
=== RUN   TestCleanPatternsLeadingSpaceTrimmed
--- PASS: TestCleanPatternsLeadingSpaceTrimmed (0.00s)
=== RUN   TestCleanPatternsTrailingSpaceTrimmed
--- PASS: TestCleanPatternsTrailingSpaceTrimmed (0.00s)
=== RUN   TestCleanPatternsErrorSingleException
--- PASS: TestCleanPatternsErrorSingleException (0.00s)
=== RUN   TestCreateIfNotExistsDir
--- PASS: TestCreateIfNotExistsDir (0.00s)
=== RUN   TestCreateIfNotExistsFile
--- PASS: TestCreateIfNotExistsFile (0.00s)
=== RUN   TestMatch
--- PASS: TestMatch (0.00s)
FAIL
FAIL	github.com/docker/docker/pkg/fileutils	0.011s
FAIL

The offending lines:

{"a\\", "a", false},
{"a\\", "a\\", false},

(note that this test is already disabled on windows, because it was failing).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions