Skip to content

Commit

Permalink
Merge pull request #33 from stefan-hoeck/compat
Browse files Browse the repository at this point in the history
[ compat ] adjust file paths to upstream changes
  • Loading branch information
stefan-hoeck authored Sep 28, 2024
2 parents c34de47 + 64a60c1 commit ba17bcb
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
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

0 comments on commit ba17bcb

Please sign in to comment.