add iden keywords and app keywords to the dialect
This commit is contained in:
parent
9f2ff37c54
commit
86f5e203af
5 changed files with 77 additions and 22 deletions
tools/Language/SQL/SimpleSQL
|
@ -4,8 +4,24 @@
|
|||
> import Language.SQL.SimpleSQL.TestTypes
|
||||
|
||||
> customDialectTests :: TestItem
|
||||
> customDialectTests = Group "custom dialect tests" (map (ParseQueryExpr myDialect) sometests
|
||||
> ++ [ParseScalarExprFails ansi2011 "SELECT DATE('2000-01-01')"])
|
||||
> customDialectTests = Group "custom dialect tests" (map (uncurry ParseQueryExpr) passTests
|
||||
> ++ map (uncurry ParseScalarExprFails) failTests )
|
||||
> where
|
||||
> myDialect = ansi2011 {diKeywords = filter (/="date") (diKeywords ansi2011)}
|
||||
> sometests = ["SELECT DATE('2000-01-01')"]
|
||||
> failTests = [(ansi2011,"SELECT DATE('2000-01-01')")
|
||||
> ,(ansi2011,"SELECT DATE")
|
||||
> ,(dateApp,"SELECT DATE")
|
||||
> ,(dateIden,"SELECT DATE('2000-01-01')")
|
||||
> -- show this never being allowed as an alias
|
||||
> ,(ansi2011,"SELECT a date")
|
||||
> ,(dateApp,"SELECT a date")
|
||||
> ,(dateIden,"SELECT a date")
|
||||
> ]
|
||||
> passTests = [(ansi2011,"SELECT a b")
|
||||
> ,(noDateKeyword,"SELECT DATE('2000-01-01')")
|
||||
> ,(noDateKeyword,"SELECT DATE")
|
||||
> ,(dateApp,"SELECT DATE('2000-01-01')")
|
||||
> ,(dateIden,"SELECT DATE")
|
||||
> ]
|
||||
> noDateKeyword = ansi2011 {diKeywords = filter (/="date") (diKeywords ansi2011)}
|
||||
> dateIden = ansi2011 {diIdentifierKeywords = "date" : diIdentifierKeywords ansi2011}
|
||||
> dateApp = ansi2011 {diAppKeywords = "date" : diAppKeywords ansi2011}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue