Skip to content

Commit

Permalink
integration-tests/bats: Add some bats tests for YYYY-M-D timestamp/da…
Browse files Browse the repository at this point in the history
…te formats.
  • Loading branch information
reltuk committed Sep 2, 2021
1 parent 217301b commit 7995467
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 2 deletions.
2 changes: 1 addition & 1 deletion go/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ require (
github.com/denisbrodbeck/machineid v1.0.1
github.com/dolthub/dolt/go/gen/proto/dolt/services/eventsapi v0.0.0-20201005193433-3ee972b1d078
github.com/dolthub/fslock v0.0.3
github.com/dolthub/go-mysql-server v0.10.1-0.20210902033752-29461bcf94ce
github.com/dolthub/go-mysql-server v0.10.1-0.20210902171148-fadb8c4592ec
github.com/dolthub/ishell v0.0.0-20210205014355-16a4ce758446
github.com/dolthub/mmap-go v1.0.4-0.20201107010347-f9f2a9588a66
github.com/dolthub/sqllogictest/go v0.0.0-20201107003712-816f3ae12d81
Expand Down
2 changes: 2 additions & 0 deletions go/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ github.com/dolthub/go-mysql-server v0.10.1-0.20210901221611-9e2a5fe1b09b h1:ITm6
github.com/dolthub/go-mysql-server v0.10.1-0.20210901221611-9e2a5fe1b09b/go.mod h1:cPg39xeFH8/+McnJxncb79SgUuREeIqR+eTvxE6OmXc=
github.com/dolthub/go-mysql-server v0.10.1-0.20210902033752-29461bcf94ce h1:jQ9XbRUBZlx8cTZKOb64m2kMnKMuktes7KtwuF+0j+o=
github.com/dolthub/go-mysql-server v0.10.1-0.20210902033752-29461bcf94ce/go.mod h1:cPg39xeFH8/+McnJxncb79SgUuREeIqR+eTvxE6OmXc=
github.com/dolthub/go-mysql-server v0.10.1-0.20210902171148-fadb8c4592ec h1:jAq5bstT/GaWYhDy46B92wOf3MTPsZEzLkv4qUBFxm0=
github.com/dolthub/go-mysql-server v0.10.1-0.20210902171148-fadb8c4592ec/go.mod h1:cPg39xeFH8/+McnJxncb79SgUuREeIqR+eTvxE6OmXc=
github.com/dolthub/ishell v0.0.0-20210205014355-16a4ce758446 h1:0ol5pj+QlKUKAtqs1LiPM3ZJKs+rHPgLSsMXmhTrCAM=
github.com/dolthub/ishell v0.0.0-20210205014355-16a4ce758446/go.mod h1:dhGBqcCEfK5kuFmeO5+WOx3hqc1k3M29c1oS/R7N4ms=
github.com/dolthub/mmap-go v1.0.4-0.20201107010347-f9f2a9588a66 h1:WRPDbpJWEnPxPmiuOTndT+lUWUeGjx6eoNOK9O4tQQQ=
Expand Down
34 changes: 33 additions & 1 deletion integration-tests/bats/types.bats
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,22 @@ SQL
run dolt sql -q "SELECT * FROM test"
[ "$status" -eq "0" ]
[[ "${lines[3]}" =~ " 1000-01-01 00:00:00 +0000 UTC " ]] || false
dolt sql -q "REPLACE INTO test VALUES (1, '1000-01-02');"
run dolt sql -q "SELECT * FROM test"
[ "$status" -eq "0" ]
[[ "${lines[3]}" =~ " 1000-01-02 00:00:00 +0000 UTC " ]] || false
dolt sql -q "REPLACE INTO test VALUES (1, '1000-01-3');"
run dolt sql -q "SELECT * FROM test"
[ "$status" -eq "0" ]
[[ "${lines[3]}" =~ " 1000-01-03 00:00:00 +0000 UTC " ]] || false
dolt sql -q "REPLACE INTO test VALUES (1, '1000-1-04');"
run dolt sql -q "SELECT * FROM test"
[ "$status" -eq "0" ]
[[ "${lines[3]}" =~ " 1000-01-04 00:00:00 +0000 UTC " ]] || false
dolt sql -q "REPLACE INTO test VALUES (1, '1000-1-5');"
run dolt sql -q "SELECT * FROM test"
[ "$status" -eq "0" ]
[[ "${lines[3]}" =~ " 1000-01-05 00:00:00 +0000 UTC " ]] || false
dolt sql -q "REPLACE INTO test VALUES (1, '9999-01-01 23:59:59.999999');"
run dolt sql -q "SELECT * FROM test"
[ "$status" -eq "0" ]
Expand Down Expand Up @@ -290,6 +306,22 @@ SQL
run dolt sql -q "SELECT * FROM test"
[ "$status" -eq "0" ]
[[ "${lines[3]}" =~ " 1000-01-01 00:00:00 +0000 UTC " ]] || false
dolt sql -q "REPLACE INTO test VALUES (1, '1000-01-02');"
run dolt sql -q "SELECT * FROM test"
[ "$status" -eq "0" ]
[[ "${lines[3]}" =~ " 1000-01-02 00:00:00 +0000 UTC " ]] || false
dolt sql -q "REPLACE INTO test VALUES (1, '1000-01-3');"
run dolt sql -q "SELECT * FROM test"
[ "$status" -eq "0" ]
[[ "${lines[3]}" =~ " 1000-01-03 00:00:00 +0000 UTC " ]] || false
dolt sql -q "REPLACE INTO test VALUES (1, '1000-1-04');"
run dolt sql -q "SELECT * FROM test"
[ "$status" -eq "0" ]
[[ "${lines[3]}" =~ " 1000-01-04 00:00:00 +0000 UTC " ]] || false
dolt sql -q "REPLACE INTO test VALUES (1, '1000-1-5');"
run dolt sql -q "SELECT * FROM test"
[ "$status" -eq "0" ]
[[ "${lines[3]}" =~ " 1000-01-05 00:00:00 +0000 UTC " ]] || false
dolt sql -q "REPLACE INTO test VALUES (1, '9999-01-01 23:59:59.999999');"
run dolt sql -q "SELECT * FROM test"
[ "$status" -eq "0" ]
Expand Down Expand Up @@ -1271,4 +1303,4 @@ SQL
[ "$status" -eq "1" ]
run dolt sql -q "INSERT INTO test VALUES (2, '2156');"
[ "$status" -eq "1" ]
}
}

0 comments on commit 7995467

Please sign in to comment.