1
Fork 0

use tasty for tests

This commit is contained in:
Jake Wheat 2015-07-31 12:45:51 +03:00
parent c156c5c34e
commit 1364c58534
4 changed files with 16 additions and 19 deletions

View file

@ -2,7 +2,7 @@ If you need help updating to a new version of simple-sql-parser,
please email jakewheatmail@gmail.com or use the github bug tracker,
https://github.com/JakeWheat/simple-sql-parser/issues.
0.4.1 (commit TBD)
0.4.1 (commit c156c5c34e91e1f7ef449d2c1ea14e282104fd90)
tested with ghc 7.4.2, 7.6.3, 7.8.4,7.10.0.20150123
simple demonstration of how dialects could be handled internally
add ability to add comments to syntax tree to help with generating

View file

@ -50,10 +50,8 @@ Test-Suite Tests
parsec >=3.1 && <3.2,
mtl >=2.1 && <2.3,
pretty >= 1.1 && < 1.2,
HUnit >= 1.2 && < 1.3,
test-framework >= 0.8 && < 0.9,
test-framework-hunit >= 0.3 && < 0.4
tasty >= 0.10 && < 0.11,
tasty-hunit >= 0.9 && < 0.10
Other-Modules: Language.SQL.SimpleSQL.Pretty,
Language.SQL.SimpleSQL.Parser,

View file

@ -9,9 +9,8 @@ test data to the Test.Framework tests.
> ,TestItem(..)
> ) where
> import Test.Framework
> import Test.Framework.Providers.HUnit
> import qualified Test.HUnit as H
> import qualified Test.Tasty as T
> import qualified Test.Tasty.HUnit as H
> --import Language.SQL.SimpleSQL.Syntax
> import Language.SQL.SimpleSQL.Pretty
@ -50,15 +49,15 @@ order on the generated documentation.
> ,mySQLTests
> ]
> tests :: Test.Framework.Test
> tests :: T.TestTree
> tests = itemToTest testData
> --runTests :: IO ()
> --runTests = void $ H.runTestTT $ itemToTest testData
> itemToTest :: TestItem -> Test.Framework.Test
> itemToTest :: TestItem -> T.TestTree
> itemToTest (Group nm ts) =
> testGroup nm $ map itemToTest ts
> T.testGroup nm $ map itemToTest ts
> itemToTest (TestValueExpr d str expected) =
> toTest parseValueExpr prettyValueExpr d str expected
> itemToTest (TestQueryExpr d str expected) =
@ -81,8 +80,8 @@ order on the generated documentation.
> -> Dialect
> -> String
> -> a
> -> Test.Framework.Test
> toTest parser pp d str expected = testCase str $ do
> -> T.TestTree
> toTest parser pp d str expected = H.testCase str $ do
> let egot = parser d "" Nothing str
> case egot of
> Left e -> H.assertFailure $ peFormattedError e
@ -103,8 +102,8 @@ order on the generated documentation.
> -> (Dialect -> a -> String)
> -> Dialect
> -> String
> -> Test.Framework.Test
> toPTest parser pp d str = testCase str $ do
> -> T.TestTree
> toPTest parser pp d str = H.testCase str $ do
> let egot = parser d "" Nothing str
> case egot of
> Left e -> H.assertFailure $ peFormattedError e
@ -123,8 +122,8 @@ order on the generated documentation.
> -> (Dialect -> a -> String)
> -> Dialect
> -> String
> -> Test.Framework.Test
> toFTest parser pp d str = testCase str $ do
> -> T.TestTree
> toFTest parser pp d str = H.testCase str $ do
> let egot = parser d "" Nothing str
> case egot of
> Left e -> return ()

View file

@ -1,8 +1,8 @@
> import Test.Framework
> import Test.Tasty
> import Language.SQL.SimpleSQL.Tests
> main :: IO ()
> main = defaultMain [tests]
> main = defaultMain tests