more OsPath conversion

About 1/10th done with this I think.
This commit is contained in:
Joey Hess 2025-01-24 13:40:09 -04:00
parent 8021d22955
commit c412c59ecd
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
16 changed files with 152 additions and 142 deletions

View file

@ -77,11 +77,11 @@ instance Quoteable RawFilePath where
data StringContainingQuotedPath
= UnquotedString String
| UnquotedByteString S.ByteString
| QuotedPath RawFilePath
| QuotedPath OsPath
| StringContainingQuotedPath :+: StringContainingQuotedPath
deriving (Show, Eq)
quotedPaths :: [RawFilePath] -> StringContainingQuotedPath
quotedPaths :: [OsPath] -> StringContainingQuotedPath
quotedPaths [] = mempty
quotedPaths (p:ps) = QuotedPath p <> if null ps
then mempty
@ -117,6 +117,6 @@ instance Monoid StringContainingQuotedPath where
-- limits what's tested to ascii, so avoids running into it.
prop_quote_unquote_roundtrip :: TestableFilePath -> Bool
prop_quote_unquote_roundtrip ts =
s == fromRawFilePath (unquote (quoteAlways (toRawFilePath s)))
s == fromOsPath (unquote (quoteAlways (toOsPath s)))
where
s = fromTestableFilePath ts