Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unicode string representation #27

Open
thautwarm opened this issue Jun 16, 2020 · 1 comment
Open

unicode string representation #27

thautwarm opened this issue Jun 16, 2020 · 1 comment

Comments

@thautwarm
Copy link
Member

concerned issues

purescript/purescript#3662

#21 (comment)

@Hong-Xiang when you have time, please give some comments about codeUnits issues which occurred while you was writing tests for purescript-quickcheck.

@Hong-Xiang
Copy link
Contributor

I suggest checking unit tests for purescript-strings may be more clear for codePoints issues, it seems codeUnits passed tests.

Related code

The error happens in runnning import Test.Data.String.CodePoints (testStringCodePoints), which locates here in original purescript-strings repo.

Details about test case

in test case, the test string is defined as

str :: String
str = "a\xDC00\xD800\xD800\x16805\x16A06z"

and tests is accessing it by index, with native python's str implemetation, when accessing it with index 1 as the following test case

import Data.String.CodePoints as SCP

assertEqual
    { actual: map show (SCP.codePointAt 1 str)
    , expected: Just "(CodePoint 0xDC00)"
    }

The results is

Exception: Expected: (Just "(CodePoint 0xDC00)")
Actual:   (Just "(CodePoint 0xFFFD)")

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

No branches or pull requests

2 participants