1
Fork 0
simple-sql-parser/tools/Language/SQL/SimpleSQL/QueryExprs.lhs

25 lines
915 B
Plaintext
Raw Normal View History

2013-12-17 10:48:40 +01:00
These are the tests for the queryExprs parsing which parses multiple
query expressions from one string.
> module Language.SQL.SimpleSQL.QueryExprs (queryExprsTests) where
> import Language.SQL.SimpleSQL.TestTypes
> import Language.SQL.SimpleSQL.Syntax
> queryExprsTests :: TestItem
> queryExprsTests = Group "query exprs" $ map (uncurry (TestStatements ansi2011))
2013-12-17 10:48:40 +01:00
> [("select 1",[ms])
> ,("select 1;",[ms])
> ,("select 1;select 1",[ms,ms])
> ,(" select 1;select 1; ",[ms,ms])
> ,("SELECT CURRENT_TIMESTAMP;"
> ,[SelectStatement $ makeSelect
> {qeSelectList = [(Iden [Name Nothing "CURRENT_TIMESTAMP"],Nothing)]}])
> ,("SELECT \"CURRENT_TIMESTAMP\";"
> ,[SelectStatement $ makeSelect
> {qeSelectList = [(Iden [Name (Just ("\"","\"")) "CURRENT_TIMESTAMP"],Nothing)]}])
2013-12-17 10:48:40 +01:00
> ]
> where
> ms = SelectStatement $ makeSelect {qeSelectList = [(NumLit "1",Nothing)]}