split misc tests
This commit is contained in:
parent
6ff8c9ddc5
commit
16bf35a6c4
|
@ -1,17 +1,18 @@
|
|||
|
||||
These is the tests for all the bits which aren't in the other files,
|
||||
mainly query exprs except the tablerefs. These tests focus on one part
|
||||
of the query expression. The FullQueries tests focus on parsing more
|
||||
complex query expressions.
|
||||
These are the tests for the query expression components apart from the
|
||||
table refs which are in a separate file.
|
||||
|
||||
> module Language.SQL.SimpleSQL.Misc (miscTests) where
|
||||
|
||||
These are a few misc tests which don't fit anywhere else.
|
||||
|
||||
> module Language.SQL.SimpleSQL.QueryExprComponents (queryExprComponentTests) where
|
||||
|
||||
> import Language.SQL.SimpleSQL.TestTypes
|
||||
> import Language.SQL.SimpleSQL.Syntax
|
||||
|
||||
|
||||
> miscTests :: TestItem
|
||||
> miscTests = Group "miscTests"
|
||||
> queryExprComponentTests :: TestItem
|
||||
> queryExprComponentTests = Group "queryExprComponentTests"
|
||||
> [duplicates
|
||||
> ,selectLists
|
||||
> ,whereClause
|
||||
|
@ -21,7 +22,6 @@ complex query expressions.
|
|||
> ,limit
|
||||
> ,combos
|
||||
> ,withQueries
|
||||
> ,queryExprsTests
|
||||
> ]
|
||||
|
||||
|
||||
|
@ -184,13 +184,3 @@ complex query expressions.
|
|||
> ms1 = ms "a" "t"
|
||||
> ms2 = ms "a" "u"
|
||||
> ms3 = ms "a" "x"
|
||||
|
||||
> queryExprsTests :: TestItem
|
||||
> queryExprsTests = Group "query exprs" $ map (uncurry TestQueryExprs)
|
||||
> [("select 1",[ms])
|
||||
> ,("select 1;",[ms])
|
||||
> ,("select 1;select 1",[ms,ms])
|
||||
> ,(" select 1;select 1; ",[ms,ms])
|
||||
> ]
|
||||
> where
|
||||
> ms = makeSelect {qeSelectList = [(Nothing,NumLit "1")]}
|
18
tools/Language/SQL/SimpleSQL/QueryExprs.lhs
Normal file
18
tools/Language/SQL/SimpleSQL/QueryExprs.lhs
Normal file
|
@ -0,0 +1,18 @@
|
|||
|
||||
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 TestQueryExprs)
|
||||
> [("select 1",[ms])
|
||||
> ,("select 1;",[ms])
|
||||
> ,("select 1;select 1",[ms,ms])
|
||||
> ,(" select 1;select 1; ",[ms,ms])
|
||||
> ]
|
||||
> where
|
||||
> ms = makeSelect {qeSelectList = [(Nothing,NumLit "1")]}
|
|
@ -26,24 +26,28 @@ tpch tests
|
|||
> import Language.SQL.SimpleSQL.TestTypes
|
||||
|
||||
> import Language.SQL.SimpleSQL.FullQueries
|
||||
> import Language.SQL.SimpleSQL.Misc
|
||||
> import Language.SQL.SimpleSQL.Postgres
|
||||
> import Language.SQL.SimpleSQL.QueryExprComponents
|
||||
> import Language.SQL.SimpleSQL.QueryExprs
|
||||
|
||||
> import Language.SQL.SimpleSQL.TableRefs
|
||||
> import Language.SQL.SimpleSQL.ScalarExprs
|
||||
> import Language.SQL.SimpleSQL.Tpch
|
||||
|
||||
|
||||
|
||||
|
||||
Order the tests to start from the simplest first. This is also the
|
||||
order on the generated documentation.
|
||||
|
||||
> testData :: TestItem
|
||||
> testData =
|
||||
> Group "parserTest"
|
||||
> [fullQueriesTests
|
||||
> ,miscTests
|
||||
> ,postgresTests
|
||||
> [scalarExprTests
|
||||
> ,queryExprComponentTests
|
||||
> ,tableRefTests
|
||||
> ,scalarExprTests
|
||||
> ,queryExprsTests
|
||||
> ,fullQueriesTests
|
||||
> ,postgresTests
|
||||
> ,tpchTests
|
||||
> ]
|
||||
|
||||
|
|
Loading…
Reference in a new issue