Skip to content
This repository has been archived by the owner on Jun 6, 2018. It is now read-only.

Avoid errors on non UTF-8 Windows #138

Merged

Conversation

matsubara0507
Copy link
Collaborator

about #135 but not file path, error is occur if the file contents includes multibyte strings (e.g. Japanese).

This problem like haddoc issue haskell/haddock#566 .

Environment

OS: Windows 10
tasty-discover: 4.1.3
GHC: 8.2.2

> stack test
tasty-discover-4.1.3: build (lib + exe + test)
Preprocessing library for tasty-discover-4.1.3..
Building library for tasty-discover-4.1.3..
Preprocessing executable 'tasty-discover' for tasty-discover-4.1.3..
Building executable 'tasty-discover' for tasty-discover-4.1.3..
Preprocessing test suite 'test' for tasty-discover-4.1.3..
Building test suite 'test' for tasty-discover-4.1.3..
tasty-discover: test\ConfigTest.hs: hGetContents: invalid argument (invalid byte sequence)
`tasty-discover' failed in phase `Haskell pre-processor'. (Exit code: 1)
Progress: 1/2
--  While building custom Setup.hs for package tasty-discover-4.1.3 using:
      C:\Users\Hoge\AppData\Roaming\stack\setup-exe-cache\i386-windows\Cabal-simple_Z6RU0evB_2.0.1.0_ghc-8.2.2.exe --builddir=.stack-work\dist\010ee936 build lib:tasty-discover exe:tasty-discover test:test --ghc-options " -ddump-hi -ddump-to-file -fdiagnostics-color=always"
    Process exited with code: ExitFailure 1

I fixed this problem, but I have not idea how to test this case.
Because, tasty-discover's test use tasty-discover .

@decentral1se
Copy link
Owner

Thanks again @matsubara0507, this is really great to get fixing.

I have not idea how to test this case.

Is it not possible to add a file path + contents of a file in the tests directory which contain problematic characters? I assume that would break something ;)

@matsubara0507
Copy link
Collaborator Author

Is it not possible to add a file path + contents of a file in the tests directory which contain problematic characters? I assume that would break something ;)

yes, test itself break if add multibyte string in test code.
e.g.
code: master...matsubara0507:test-multibyte-string
test result: https://ci.appveyor.com/project/matsubara0507/tasty-discover/build/1.0.9#L438

@decentral1se
Copy link
Owner

OK, I'm gonna get this merged and released then! Thanks @matsubara0507 👏

@decentral1se decentral1se merged commit 84d655a into decentral1se:master Feb 26, 2018
@decentral1se
Copy link
Owner

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants