packages feed

hsnock 0.1.4 → 0.2.0

raw patch · 3 files changed

+21/−6 lines, 3 filesdep +HUnitdep +test-framework-hunit

Dependencies added: HUnit, test-framework-hunit

Files

Language/Nock5K/Spec.lhs view
@@ -131,7 +131,7 @@    *[a 10 [b c] d]   *[a 8 c 7 [0 3] d] -> tar (a :- Atom 10 :- (b :- c) :- d) =+> tar (a :- Atom 10 :- (b :- c) :- d) = tar (a :- c) `seq` >   tar (a :- Atom 8 :- c :- Atom 7 :- (Atom 0 :- Atom 3) :- d)    *[a 10 b c]       *[a c]
hsnock.cabal view
@@ -1,5 +1,5 @@ name                 : hsnock-version              : 0.1.4+version              : 0.2.0 category             : Language license              : PublicDomain synopsis             : Nock 5K interpreter.@@ -34,8 +34,10 @@   type               : exitcode-stdio-1.0   main-is            : test.hs   build-depends      : base >=4.5 && <5+                     , HUnit >=1.2+                     , QuickCheck >=2.6                      , parsec >=3.1                      , readline >=1.0-                     , QuickCheck >=2.6                      , test-framework >=0.8+                     , test-framework-hunit >=0.3                      , test-framework-quickcheck2 >=0.3
test.hs view
@@ -1,7 +1,10 @@ import Control.Applicative+import qualified Control.Exception as C import Language.Nock5K import Test.Framework+import Test.Framework.Providers.HUnit import Test.Framework.Providers.QuickCheck2+import Test.HUnit import Test.QuickCheck import Text.ParserCombinators.Parsec (parse) import Text.Printf@@ -35,7 +38,17 @@     ifs c = Atom a :- Atom 6 :- (Atom 1 :- c) :- (Atom 4 :- Atom 0 :- Atom 1) :- (Atom 1 :- b)     a = abs a' -tests = [ testProperty "parse.show" prop_parse_show-        , testProperty "decrement"  prop_dec-        , testProperty "6_is_if"    prop_6_is_if+test_hint_crash =+  C.catch (nock bad `seq` assertFailure "Hint not evaluated")+          (\e -> do let se = show (e :: C.ErrorCall)+                    if se == "/a"+                      then return ()+                      else assertFailure $ "Exception: " ++ se)+ where+  bad = Atom 42 :- Atom 10 :- (Atom 0 :- Atom 0 :- Atom 2) :- Atom 0 :- Atom 1++tests = [ testProperty "parse.show"    prop_parse_show+        , testProperty "decrement"     prop_dec+        , testProperty "6_is_if"       prop_6_is_if+        , testCase     "10_hint_crash" test_hint_crash         ]