Skip to content

json module encodes invalid unicode code points in test #7611

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

Closed
thestinger opened this issue Jul 6, 2013 · 0 comments
Closed

json module encodes invalid unicode code points in test #7611

thestinger opened this issue Jul 6, 2013 · 0 comments

Comments

@thestinger
Copy link
Contributor

I've had to xfail this test for now to fix str. The problem line is assert_eq!(from_str("\"").

    fn test_read_str() {
        assert_eq!(from_str("\""),
            Err(Error {line: 1u, col: 2u, msg: @~"EOF while parsing string"
        }));
        assert_eq!(from_str("\"lol"),
            Err(Error {line: 1u, col: 5u, msg: @~"EOF while parsing string"
        }));

        assert_eq!(from_str("\"\""), Ok(String(~"")));
        assert_eq!(from_str("\"foo\""), Ok(String(~"foo")));
        assert_eq!(from_str("\"\\\"\""), Ok(String(~"\"")));
        assert_eq!(from_str("\"\\b\""), Ok(String(~"\x08")));
        assert_eq!(from_str("\"\\n\""), Ok(String(~"\n")));
        assert_eq!(from_str("\"\\r\""), Ok(String(~"\r")));
        assert_eq!(from_str("\"\\t\""), Ok(String(~"\t")));
        assert_eq!(from_str(" \"foo\" "), Ok(String(~"foo")));
        assert_eq!(from_str("\"\\u12ab\""), Ok(String(~"\u12ab")));
        assert_eq!(from_str("\"\\uAB12\""), Ok(String(~"\uAB12")));
    }
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

Successfully merging a pull request may close this issue.

1 participant