File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -265,7 +265,7 @@ genValidUnicodeChar = arbitraryUnicodeChar `suchThat` isCharacter
265
265
where isCharacter x = x /= '\ 65534 ' && x /= '\ 65535 '
266
266
267
267
normalizedFilePathSpec :: Spec
268
- normalizedFilePathSpec = do
268
+ normalizedFilePathSpec = beforeAll (setFileSystemEncoding utf8) $ do
269
269
it " makes file path normalized" $ property $ forAll genFilePath $ \ fp -> do
270
270
let nfp = toNormalizedFilePath fp
271
271
fromNormalizedFilePath nfp `shouldBe` (normalise fp)
@@ -297,12 +297,11 @@ normalizedFilePathSpec = do
297
297
it " converts to NormalizedFilePath and back sucessfully" $ property $ forAll genFilePath $ \ fp -> do
298
298
let osPath = fromJust (OsPath. encodeUtf fp)
299
299
osPath' <- osPathToNormalizedFilePath osPath >>= normalizedFilePathToOsPath
300
- osPath' `shouldBe` osPath
300
+ osPath' `shouldBe` OsPath. normalise osPath
301
301
302
302
it " can not convert OsPath in non-standard encoding to NormalizedFilePath" $ do
303
303
-- \184921 is an example that the raw bytes of UTF16 is not valid UTF8.
304
304
-- Case like this is not very common. I found it with the help of QuickCheck.
305
- setFileSystemEncoding utf8
306
305
case OsPath. encodeWith utf16be utf16be " \184921" of
307
306
Left err -> throwIO err
308
307
Right osPath -> do
You can’t perform that action at this time.
0 commit comments