-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Port DATE and TIME parse tests from Kotlin implementation #14
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,183 @@ | ||
parse::{ | ||
name: "missing DATE string", | ||
statement: "DATE", | ||
assert: { | ||
result: ParseError | ||
}, | ||
} | ||
|
||
parse::{ | ||
name: "invalid type INT for DATE string", | ||
statement: "DATE 2012", | ||
assert: { | ||
result: ParseError | ||
}, | ||
} | ||
|
||
parse::{ | ||
name: "invalid DATE string without single quotes", | ||
statement: "DATE 2012-08-28", | ||
assert: { | ||
result: ParseError | ||
}, | ||
} | ||
|
||
parse::{ | ||
name: "invalid DATE string using Ion literal", | ||
statement: "DATE `2012-08-28`", | ||
assert: { | ||
result: ParseError | ||
}, | ||
} | ||
|
||
parse::{ | ||
name: "invalid DATE STRING literal", | ||
statement: "DATE 'date_string'", | ||
assert: { | ||
result: ParseError | ||
}, | ||
} | ||
|
||
parse::{ | ||
name: "invalid DATE string format missing dashes", | ||
statement: "DATE '20210310'", | ||
assert: { | ||
result: ParseError | ||
}, | ||
} | ||
|
||
parse::{ | ||
name: "invalid DATE string format unexpected colons", | ||
statement: "DATE '2021:03:10'", | ||
assert: { | ||
result: ParseError | ||
}, | ||
} | ||
|
||
parse::{ | ||
name: "invalid DATE string no starting single quotation", | ||
statement: "DATE 2021-03-10'", | ||
assert: { | ||
result: ParseError | ||
}, | ||
} | ||
|
||
parse::{ | ||
name: "invalid DATE string no ending single quotation", | ||
statement: "DATE '2021-03-10", | ||
assert: { | ||
result: ParseError | ||
}, | ||
} | ||
|
||
parse::{ | ||
name: "invalid DATE string format MMDDYYYY", | ||
statement: "DATE '03-25-2021'", | ||
assert: { | ||
result: ParseError | ||
}, | ||
} | ||
|
||
parse::{ | ||
name: "invalid DATE string format DDMMYYYY", | ||
statement: "DATE '25-03-2021'", | ||
assert: { | ||
result: ParseError | ||
}, | ||
} | ||
|
||
parse::{ | ||
name: "invalid DATE string minus before year", | ||
statement: "DATE '-9999-03-10'", | ||
assert: { | ||
result: ParseError | ||
}, | ||
} | ||
|
||
parse::{ | ||
name: "invalid DATE string plus before year", | ||
statement: "DATE '+9999-03-10'", | ||
assert: { | ||
result: ParseError | ||
}, | ||
} | ||
|
||
parse::{ | ||
name: "invalid DATE string extra minus between year and month", | ||
statement: "DATE '2021--03-10'", | ||
assert: { | ||
result: ParseError | ||
}, | ||
} | ||
|
||
parse::{ | ||
name: "invalid DATE string plus between year and month", | ||
statement: "DATE '2021-+03-10'", | ||
assert: { | ||
result: ParseError | ||
}, | ||
} | ||
|
||
parse::{ | ||
name: "invalid DATE string extra minus between month and day", | ||
statement: "DATE '2021-03--10'", | ||
assert: { | ||
result: ParseError | ||
}, | ||
} | ||
|
||
parse::{ | ||
name: "invalid DATE string plus between month and day", | ||
statement: "DATE '2021-03-+10'", | ||
assert: { | ||
result: ParseError | ||
}, | ||
} | ||
|
||
parse::{ | ||
name: "invalid DATE string month out of range", | ||
statement: "DATE '2021-12345-10'", | ||
assert: { | ||
result: ParseError | ||
}, | ||
} | ||
|
||
parse::{ | ||
name: "invalid DATE string day out of range", | ||
statement: "DATE '2021-03-12345'", | ||
assert: { | ||
result: ParseError | ||
}, | ||
} | ||
|
||
parse::{ | ||
name: "invalid DATE string year missing padded zero", | ||
statement: "DATE '123-03-10'", | ||
assert: { | ||
result: ParseError | ||
}, | ||
} | ||
|
||
parse::{ | ||
name: "invalid DATE string month missing padded zero", | ||
statement: "DATE '2021-3-10'", | ||
assert: { | ||
result: ParseError | ||
}, | ||
} | ||
|
||
parse::{ | ||
name: "invalid DATE string day missing padded zero", | ||
statement: "DATE '2021-03-1'", | ||
assert: { | ||
result: ParseError | ||
}, | ||
} | ||
|
||
parse::{ | ||
name: "invalid DATE string year beyond 9999", | ||
statement: "DATE '12345-03-10'", | ||
assert: { | ||
result: ParseError | ||
}, | ||
} | ||
Comment on lines
+153
to
+183
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The SQL-92 spec says the year is 4 digits while month and day are both 2 digits:
PostgreSQL allows these other There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree, let's leave it at SQL Compatibility for now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit. unrelated to this PR: looks like the indentation is incorrect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the rendered markdown, the indentation is consistent with the other tests in that list.