Skip to content

Commit

Permalink
add an invalid DSN test case (go-sql-driver#1235)
Browse files Browse the repository at this point in the history
  • Loading branch information
zihengCat committed Jul 18, 2021
1 parent 75d09ac commit 6a88ab9
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions dsn_test.go
Expand Up @@ -92,13 +92,14 @@ func TestDSNParser(t *testing.T) {

func TestDSNParserInvalid(t *testing.T) {
var invalidDSNs = []string{
"@net(addr/", // no closing brace
"@tcp(/", // no closing brace
"tcp(/", // no closing brace
"(/", // no closing brace
"net(addr)//", // unescaped
"User:pass@tcp(1.2.3.4:3306)", // no trailing slash
"net()/", // unknown default addr
"@net(addr/", // no closing brace
"@tcp(/", // no closing brace
"tcp(/", // no closing brace
"(/", // no closing brace
"net(addr)//", // unescaped
"User:pass@tcp(1.2.3.4:3306)", // no trailing slash
"net()/", // unknown default addr
"user:pass@tcp(127.0.0.1:3306)/db/name", // invalid dbname
//"/dbname?arg=/some/unescaped/path",
}

Expand Down

0 comments on commit 6a88ab9

Please sign in to comment.