summaryrefslogtreecommitdiff
path: root/edit-lens/test/Control/DFST/LensTest.hs
blob: 46a189663ccd77e516c14c2ac1127edbff8016a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
module Control.DFST.LensTest where

import Prelude hiding (init)

import Control.DFST
import Control.DFST.Lens
import Control.FST hiding (stInitial, stTransition, stAccept)

import Data.Set (Set)
import qualified Data.Set as Set

import Data.Map.Strict (Map)
import qualified Data.Map.Strict as Map

import Data.Sequence (Seq)
import qualified Data.Sequence as Seq

import Data.Maybe (maybeToList)

import Test.Tasty
import Test.Tasty.Hedgehog
import Test.Tasty.HUnit hiding (assert)

import Hedgehog
import qualified Hedgehog.Gen as G
import qualified Hedgehog.Range as R

import Numeric.Natural

import Control.DFSTTest

hprop_applyDivInit :: Property
hprop_applyDivInit = property $ do
  word <- Seq.fromList <$> forAll genWord
  init @(StringEdits Natural) `apply` (divInit word :: StringEdits Natural) === Just word