summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/lib/pq/encode_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/lib/pq/encode_test.go')
-rw-r--r--vendor/github.com/lib/pq/encode_test.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/vendor/github.com/lib/pq/encode_test.go b/vendor/github.com/lib/pq/encode_test.go
index 3a0f7286e..837d45bec 100644
--- a/vendor/github.com/lib/pq/encode_test.go
+++ b/vendor/github.com/lib/pq/encode_test.go
@@ -37,6 +37,8 @@ var timeTests = []struct {
}{
{"22001-02-03", time.Date(22001, time.February, 3, 0, 0, 0, 0, time.FixedZone("", 0))},
{"2001-02-03", time.Date(2001, time.February, 3, 0, 0, 0, 0, time.FixedZone("", 0))},
+ {"0001-12-31 BC", time.Date(0, time.December, 31, 0, 0, 0, 0, time.FixedZone("", 0))},
+ {"2001-02-03 BC", time.Date(-2000, time.February, 3, 0, 0, 0, 0, time.FixedZone("", 0))},
{"2001-02-03 04:05:06", time.Date(2001, time.February, 3, 4, 5, 6, 0, time.FixedZone("", 0))},
{"2001-02-03 04:05:06.000001", time.Date(2001, time.February, 3, 4, 5, 6, 1000, time.FixedZone("", 0))},
{"2001-02-03 04:05:06.00001", time.Date(2001, time.February, 3, 4, 5, 6, 10000, time.FixedZone("", 0))},
@@ -86,15 +88,22 @@ func TestParseTs(t *testing.T) {
}
var timeErrorTests = []string{
+ "BC",
+ " BC",
"2001",
"2001-2-03",
"2001-02-3",
"2001-02-03 ",
+ "2001-02-03 B",
"2001-02-03 04",
"2001-02-03 04:",
"2001-02-03 04:05",
+ "2001-02-03 04:05 B",
+ "2001-02-03 04:05 BC",
"2001-02-03 04:05:",
"2001-02-03 04:05:6",
+ "2001-02-03 04:05:06 B",
+ "2001-02-03 04:05:06BC",
"2001-02-03 04:05:06.123 B",
}