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

This library does not appear to pass all tests in toml-test #4

Open
jbclements opened this issue Dec 5, 2022 · 0 comments
Open

This library does not appear to pass all tests in toml-test #4

jbclements opened this issue Dec 5, 2022 · 0 comments

Comments

@jbclements
Copy link

I took a look at this library today, and it appears that it is not actually a correct implementation of TOML 1.0.0. I tried running some of the tests in https://github.com/BurntSushi/toml-test , using a janky racket back-end to spit out JSON encodings. While this back-end is very incomplete, the resulting test failures suggest that your TOML library is not correctly parsing a bunch of the different TOML 1.0.0 string forms. Here's one example input from the test library:

      backspace = 'This string has a \b backspace character.'
       tab = 'This string has a \t tab character.'
       newline = 'This string has a \n new line character.'
       formfeed = 'This string has a \f form feed character.'
       carriage = 'This string has a \r carriage return character.'
       slash = 'This string has a \/ slash character.'
       backslash = 'This string has a \\ backslash character.'

It produces this output:

(root ("backspace" . "Parser Error: invalid literal or str")
  ("tab" . "Parser Error: invalid literal or str")
  ("newline" . "Parser Error: invalid literal or str")
  ("formfeed" . "Parser Error: invalid literal or str")
  ("carriage" . "Parser Error: invalid literal or str")
  ("slash" . "Parser Error: invalid literal or str")
  ("backslash" . "Parser Error: invalid literal or str"))

Here's another one:

      # Single ' should be allowed.
       oneline = '''This string has a ' quote character.'''
       
       # A newline immediately following the opening delimiter will be trimmed.
       firstnl = '''
       This string has a ' quote character.'''
       
       # All other whitespace and newline characters remain intact.
       multiline = '''
       This string
       has ' a quote character
       and more than
       one newline
       in it.'''

it produces this error:

(root
  ("oneline" . "Parser Error: invalid literal or str")
  ("firstnl" . "Parser Error: invalid literal or str")
  ("multiline" . "Parser Error: invalid literal or str"))
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

1 participant