@@ -0,0 +1,51 @@
1+module Regression.T9 (test9) where
3+import Control.Ether.Abbr
4+import Control.Monad.Ether
7+import Test.Tasty.QuickCheck
13+testEther1 :: Ether '[Foo <-> Int] m => m String
18+testEther2 :: Ether '[Bar <-> Int] m => m String
19+testEther2 = tagReplace foo bar testEther1
22+ :: Ether '[Foo <-> Int, Bar <-> Int] m
29+model :: Int -> Int -> String
30+model a b = show (negate a) ++ show (negate b)
33+ = flip (evalState foo) a
34+ . flip (evalStateT bar) b
37+ = flip (evalState bar) b
38+ . flip (evalStateT foo) a
41+test9 = testGroup "T9: Tag replacement"
42+ [ testProperty "runner₁ works"
44+ $ runner1 a b testEther == model a b
45+ , testProperty "runner₂ works"
47+ $ runner2 a b testEther == model a b
48+ , testProperty "runner₁ == runner₂"
50+ $ runner1 a b testEther == runner2 a b testEther