How to Test Japanese on Haskell's Doctorest

Asked 2 years ago, Updated 2 years ago, 123 views

I'd like to know how to test Japanese on Haskell's doctor test

module Main where    
-- | Displayed in Japanese
-- >> hoge
-- "Japanese"
hoge::String
hoge="Japanese"

main ::IO()
main = print hoge

Testing the above content

expected:"Japanese"
butgot: "\26085\26412\35486"
Examples:1 Tried:1 Errors:0 Failures:1

It will be

File and system character codes are consistent with UTF8
doctorest version 0.9.11.1

Please let me know if there is a solution.
Thank you for your cooperation.

haskell

2022-09-30 19:33

1 Answers

It's a remedy, but how about using putStr?
As far as doctest Usage is concerned, it seems to work as you typed in ghci.

Example:

 --| Display in Japanese
-- >> putStrhoge
-- Japanese
hoge::String
hoge="Japanese"


2022-09-30 19:33

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.