Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
U
unix
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ian-Woo Kim
unix
Commits
87c4b73a
Commit
87c4b73a
authored
1 year ago
by
Bodigrim
Committed by
Bodigrim
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Test withFilePath
parent
fadc6e1b
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/Test.hs
+20
-0
20 additions, 0 deletions
tests/Test.hs
unix.cabal
+1
-1
1 addition, 1 deletion
unix.cabal
with
21 additions
and
1 deletion
tests/Test.hs
+
20
−
0
View file @
87c4b73a
...
...
@@ -10,13 +10,19 @@ import Control.Applicative
import
Control.Concurrent
import
qualified
Control.Exception
as
E
import
Control.Monad
import
qualified
Data.ByteString
as
B
import
qualified
Data.ByteString.Short
as
Sh
import
Data.List
(
sort
)
import
System.Exit
import
System.IO
import
System.OsString.Internal.Types
import
System.Posix
import
qualified
System.Posix.Env.ByteString
as
ByteString
import
qualified
System.Posix.ByteString.FilePath
as
BSFP
import
qualified
System.Posix.PosixPath.FilePath
as
PPFP
import
Test.Tasty
import
Test.Tasty.HUnit
import
Test.Tasty.QuickCheck
import
qualified
FileStatus
import
qualified
FileStatusByteString
...
...
@@ -49,6 +55,7 @@ main = defaultMain $ testGroup "All"
,
posix010
-- JS: missing "sysconf"
]
#
endif
,
testWithFilePath
]
executeFile001
::
TestTree
...
...
@@ -245,6 +252,19 @@ posix010 = testCase "posix010" $ do
homeDirectory
root
@?=
homeDirectory
root'
testWithFilePath
::
TestTree
testWithFilePath
=
testGroup
"withFilePath"
[
testProperty
"ByteString"
$
\
xs
->
let
ys
=
B
.
pack
$
filter
(
/=
0
)
xs
in
ioProperty
$
BSFP
.
withFilePath
ys
(
\
ptr
->
(
===
ys
)
<$>
B
.
packCString
ptr
)
,
testProperty
"PosixPath"
$
\
xs
->
let
ys
=
Sh
.
pack
$
filter
(
/=
0
)
xs
in
ioProperty
$
PPFP
.
withFilePath
(
PosixString
ys
)
(
\
ptr
->
(
===
ys
)
<$>
Sh
.
packCString
ptr
)
]
-------------------------------------------------------------------------------
-- Utils
...
...
This diff is collapsed.
Click to expand it.
unix.cabal
+
1
−
1
View file @
87c4b73a
...
...
@@ -171,7 +171,7 @@ test-suite unix-tests
Signals001
type: exitcode-stdio-1.0
default-language: Haskell2010
build-depends: base,
tasty, tasty-hunit
, unix
build-depends: base,
bytestring, filepath, tasty, tasty-hunit, tasty-quickcheck
, unix
ghc-options: -Wall -with-rtsopts=-V0
test-suite FdReadBuf001
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment