Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ compat ] adjust file paths to upstream changes #33

Merged
merged 1 commit into from
Sep 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions pack.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,9 @@ type = "git"
url = "https://github.com/stefan-hoeck/idris2-quantifiers-extra"
commit = "latest:main"
ipkg = "quantifiers-extra.ipkg"

[custom.all.filepath]
type = "git"
url = "https://github.com/stefan-hoeck/idris2-filepath"
commit = "latest:main"
ipkg = "filepath.ipkg"
8 changes: 4 additions & 4 deletions src/Control/RIO/Mock/File.idr
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ selfOrParent fp = maybe fp fst $ split fp

export
mkdirFocus : MockDir -> Path Abs -> Maybe Focus
mkdirFocus (MkMD ps) (PAbs sx) = go [<] ps (sx <>> [])
mkdirFocus (MkMD ps) (PAbs u sx) = go [<] ps (sx <>> [])

where
go :
Expand All @@ -101,7 +101,7 @@ mkdirFocus (MkMD ps) (PAbs sx) = go [<] ps (sx <>> [])

export
dirFocus : MockDir -> Path Abs -> Maybe Focus
dirFocus (MkMD ps) (PAbs sx) = go [<] ps (sx <>> [])
dirFocus (MkMD ps) (PAbs u sx) = go [<] ps (sx <>> [])

where
go :
Expand Down Expand Up @@ -137,8 +137,8 @@ record MockFS where
curDir : Path Abs

absPath : MockFS -> Path t -> Path Abs
absPath fs (PAbs sx) = PAbs sx
absPath fs (PRel sx) = fs.curDir </> PRel sx
absPath fs (PAbs u sx) = PAbs u sx
absPath fs (PRel sx) = fs.curDir </> PRel sx

export
fsFocus : MockFS -> Path t -> Maybe Focus
Expand Down
9 changes: 8 additions & 1 deletion test/src/FSProps.idr
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,16 @@ export
relDir : Gen (Path Rel)
relDir = PRel . (Lin <><) <$> list (linear 0 6) body

export
absType : Gen AbsType
absType = choice [pure Unix, map Disk upper, [| UNC body' body' |]]

export
absDir : Gen (Path Abs)
absDir = PAbs . (Lin <><) <$> list (linear 0 6) body
absDir = [| PAbs absType pth |]
where
pth : Gen (SnocList Body)
pth = (Lin <><) <$> list (linear 0 6) body

export
dir : Gen FilePath
Expand Down
Loading