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,
|
These are the tests for the query expression components apart from the
|
||||||
mainly query exprs except the tablerefs. These tests focus on one part
|
table refs which are in a separate file.
|
||||||
of the query expression. The FullQueries tests focus on parsing more
|
|
||||||
complex query expressions.
|
|
||||||
|
|
||||||
> 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.TestTypes
|
||||||
> import Language.SQL.SimpleSQL.Syntax
|
> import Language.SQL.SimpleSQL.Syntax
|
||||||
|
|
||||||
|
|
||||||
> miscTests :: TestItem
|
> queryExprComponentTests :: TestItem
|
||||||
> miscTests = Group "miscTests"
|
> queryExprComponentTests = Group "queryExprComponentTests"
|
||||||
> [duplicates
|
> [duplicates
|
||||||
> ,selectLists
|
> ,selectLists
|
||||||
> ,whereClause
|
> ,whereClause
|
||||||
|
@ -21,7 +22,6 @@ complex query expressions.
|
||||||
> ,limit
|
> ,limit
|
||||||
> ,combos
|
> ,combos
|
||||||
> ,withQueries
|
> ,withQueries
|
||||||
> ,queryExprsTests
|
|
||||||
> ]
|
> ]
|
||||||
|
|
||||||
|
|
||||||
|
@ -184,13 +184,3 @@ complex query expressions.
|
||||||
> ms1 = ms "a" "t"
|
> ms1 = ms "a" "t"
|
||||||
> ms2 = ms "a" "u"
|
> ms2 = ms "a" "u"
|
||||||
> ms3 = ms "a" "x"
|
> 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.TestTypes
|
||||||
|
|
||||||
> import Language.SQL.SimpleSQL.FullQueries
|
> import Language.SQL.SimpleSQL.FullQueries
|
||||||
> import Language.SQL.SimpleSQL.Misc
|
|
||||||
> import Language.SQL.SimpleSQL.Postgres
|
> import Language.SQL.SimpleSQL.Postgres
|
||||||
|
> import Language.SQL.SimpleSQL.QueryExprComponents
|
||||||
|
> import Language.SQL.SimpleSQL.QueryExprs
|
||||||
|
|
||||||
> import Language.SQL.SimpleSQL.TableRefs
|
> import Language.SQL.SimpleSQL.TableRefs
|
||||||
> import Language.SQL.SimpleSQL.ScalarExprs
|
> import Language.SQL.SimpleSQL.ScalarExprs
|
||||||
> import Language.SQL.SimpleSQL.Tpch
|
> 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 :: TestItem
|
||||||
> testData =
|
> testData =
|
||||||
> Group "parserTest"
|
> Group "parserTest"
|
||||||
> [fullQueriesTests
|
> [scalarExprTests
|
||||||
> ,miscTests
|
> ,queryExprComponentTests
|
||||||
> ,postgresTests
|
|
||||||
> ,tableRefTests
|
> ,tableRefTests
|
||||||
> ,scalarExprTests
|
> ,queryExprsTests
|
||||||
|
> ,fullQueriesTests
|
||||||
|
> ,postgresTests
|
||||||
> ,tpchTests
|
> ,tpchTests
|
||||||
> ]
|
> ]
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue