module Main (main) where

import Control.Monad (unless)
import Test.Tasty
import Test.Tasty.Falsify

import qualified Test.Falsify.Generator as Gen
import qualified Test.Falsify.Range as Ran

import qualified GardGround.Utils.ScopeMask as ScM

main :: IO ()
main = defaultMain $
  testProperty "scope mask list roundtrip" $ do
    x <- gen . Gen.inRange $ Ran.between (0, 10000000)
    let x' = toEnum x :: Integer
    let ScM.ScopeMask y = ScM.fromList . ScM.toList $ ScM.ScopeMask x'
    unless (x' == y) $ testFailed "roundtrip failed"