Skip to content

Commit

Permalink
Add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hasufell committed Aug 16, 2021
1 parent c99a7c5 commit 2f54c68
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/AbstractFilePathSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
module AbstractFilePathSpec where

import AFP.AbstractFilePath
import AFP.OsString.Internal.Types
import AFP.Data.ByteString.Short.Decode
( decodeUtf16LE, decodeUtf8 )
import AFP.Data.ByteString.Short.Encode
Expand Down Expand Up @@ -31,3 +32,15 @@ spec = do

testBatch (ord (\(a :: AbstractFilePath) -> pure a))
testBatch (monoid (undefined :: AbstractFilePath))

testBatch (ord (\(a :: OsString) -> pure a))
testBatch (monoid (undefined :: OsString))

testBatch (ord (\(a :: WindowsString) -> pure a))
testBatch (monoid (undefined :: WindowsString))

testBatch (ord (\(a :: PosixString) -> pure a))
testBatch (monoid (undefined :: PosixString))

testBatch (ord (\(a :: PlatformString) -> pure a))
testBatch (monoid (undefined :: PlatformString))
15 changes: 15 additions & 0 deletions test/Arbitrary.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
module Arbitrary where

import AFP.OsString
import AFP.OsString.Internal.Types
import qualified AFP.OsString.Posix as Posix
import qualified AFP.OsString.Windows as Windows

import Test.QuickCheck.Arbitrary
import Test.QuickCheck.Checkers
Expand All @@ -10,3 +13,15 @@ instance Arbitrary OsString where

instance EqProp OsString where
(=-=) = eq

instance Arbitrary PosixString where
arbitrary = Posix.toPlatformString <$> arbitrary

instance EqProp PosixString where
(=-=) = eq

instance Arbitrary WindowsString where
arbitrary = Windows.toPlatformString <$> arbitrary

instance EqProp WindowsString where
(=-=) = eq

0 comments on commit 2f54c68

Please sign in to comment.