aboutsummaryrefslogtreecommitdiffstats
path: root/tests/Unit.hs
diff options
context:
space:
mode:
authorYann Herklotz <ymherklotz@gmail.com>2019-01-09 21:13:04 +0000
committerYann Herklotz <ymherklotz@gmail.com>2019-01-09 21:13:04 +0000
commit9f829c41651cd2872b1c6e666b5bceeebf829aee (patch)
tree2d68f84e159fe0d089d96443a33220bec307a452 /tests/Unit.hs
parenta8436846201d03b80d8b11b68ef07923bb2997b4 (diff)
downloadverismith-9f829c41651cd2872b1c6e666b5bceeebf829aee.tar.gz
verismith-9f829c41651cd2872b1c6e666b5bceeebf829aee.zip
Move tests to test
Diffstat (limited to 'tests/Unit.hs')
-rw-r--r--tests/Unit.hs42
1 files changed, 0 insertions, 42 deletions
diff --git a/tests/Unit.hs b/tests/Unit.hs
deleted file mode 100644
index 13b9027..0000000
--- a/tests/Unit.hs
+++ /dev/null
@@ -1,42 +0,0 @@
-module Unit (unitTests) where
-
-import Control.Lens
-import qualified Data.Graph.Inductive as G
-import Data.Text (Text)
-import qualified Data.Text as T
-import Test.Tasty
-import Test.Tasty.HUnit
-import Test.VeriFuzz
-
-unitTests = testGroup "Unit tests"
- [ testCase "Transformation of AST" $
- assertEqual "Successful transformation" transformExpectedResult
- (transformOf traverseExpr trans transformTestData)
- ]
-
-transformTestData :: Expr
-transformTestData = BinOp (BinOp (BinOp (Id "id1") BinAnd (Id "id2")) BinAnd
- (BinOp (Id "id1") BinAnd (Id "id2"))) BinAnd
- (BinOp (BinOp (BinOp (Id "id1") BinAnd (Id "id2")) BinAnd
- (BinOp (Id "id1") BinAnd (BinOp (BinOp (Id "id1") BinAnd (Id "id2")) BinAnd
- (BinOp (Id "id1") BinAnd (Id "id2"))))) BinOr
- (Concat [Concat [ Concat [Id "id1", Id "id2", Id "id2"], Id "id2", Id "id2"
- , Concat [Id "id2", Id "id2", Concat [Id "id1", Id "id2"]]
- , Id "id2"], Id "id1", Id "id2"]))
-
-transformExpectedResult :: Expr
-transformExpectedResult = BinOp (BinOp (BinOp (Id "id1") BinAnd (Id "Replaced")) BinAnd
- (BinOp (Id "id1") BinAnd (Id "Replaced"))) BinAnd
- (BinOp (BinOp (BinOp (Id "id1") BinAnd (Id "Replaced")) BinAnd
- (BinOp (Id "id1") BinAnd (BinOp (BinOp (Id "id1") BinAnd (Id "Replaced")) BinAnd
- (BinOp (Id "id1") BinAnd (Id "Replaced"))))) BinOr
- (Concat [Concat [ Concat [Id "id1", Id "Replaced", Id "Replaced"], Id "Replaced", Id "Replaced"
- , Concat [Id "Replaced", Id "Replaced", Concat [Id "id1", Id "Replaced"]]
- , Id "Replaced"], Id "id1", Id "Replaced"]))
-
-trans e =
- case e of
- Id id -> if id == Identifier "id2" then
- Id $ Identifier "Replaced"
- else Id id
- _ -> e