Skip to content

Commit

Permalink
syntax: add more pattern matching edge case tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdan committed Jan 16, 2018
1 parent d35f2ef commit 088eca5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions syntax/pattern_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ var translateTests = []struct {
{`[!bc]`, false, `[^bc]`, false},
{`[[]`, false, `[[]`, false},
{`[]]`, false, `[]]`, false},
{`[^]]`, false, `[^]]`, false},
{`[`, false, "", true},
{`[]`, false, "", true},
{`[^]`, false, "", true},
Expand All @@ -42,6 +43,9 @@ var translateTests = []struct {
{`[a-a]`, false, "[a-a]", false},
{`[aa]`, false, `[aa]`, false},
{`[0-4A-Z]`, false, `[0-4A-Z]`, false},
{`[-a]`, false, "[-a]", false},
{`[^-a]`, false, "[^-a]", false},
{`[a-]`, false, "[a-]", false},
{`[[:digit:]]`, false, `[[:digit:]]`, false},
{`[[:`, false, "", true},
{`[[:digit`, false, "", true},
Expand Down

0 comments on commit 088eca5

Please sign in to comment.