]> Git — Sourcephile - gargantext.git/blob - src-test/Core/Text/Corpus/Query.hs
Prepare for corpusQuery tests
[gargantext.git] / src-test / Core / Text / Corpus / Query.hs
1 {-# LANGUAGE OverloadedStrings #-}
2 module Core.Text.Corpus.Query where
3
4 import Data.BoolExpr
5 import Gargantext.Core.Text.Corpus.Query
6 import Prelude
7
8 import Test.Tasty
9 import Test.Tasty.QuickCheck hiding (Positive)
10
11 main :: IO ()
12 main = defaultMain tests
13
14 tests :: TestTree
15 tests = testGroup "Boolean Query Engine" [
16 testProperty "Parses 'A OR B'" testParse01
17 ]
18
19 testParse01 :: Property
20 testParse01 =
21 (renderQuery <$> parseQuery "A OR B") === (renderQuery <$> Right (unsafeMkQuery $ (BConst (Positive "A") `BOr` BConst (Positive "B"))))