Giter Club home page Giter Club logo

Comments (4)

arp242 avatar arp242 commented on September 28, 2024 1

That's actually a different issue @glguy, with the "I" in "Inf" being capitalized sometimes. That was fixed last year. I'm not 100% sure if that's in the latest tagged release (need to look that up), but it's definitely in the latest master.

Verified with:

% git log -n1 
commit 4bcf07d (HEAD -> main, tag: toml-parser-2.0.0.0, origin/main, origin/HEAD)
Author: Eric Mertens <[email protected]>
Date:   Sat Feb 24 08:27:42 2024 -0800

    Use NonEmpty in lexer context stack

% git diff
diff --git i/test-drivers/encoder/Main.hs w/test-drivers/encoder/Main.hs
index 73998b2..e322d23 100644
--- i/test-drivers/encoder/Main.hs
+++ w/test-drivers/encoder/Main.hs
@@ -56,6 +56,6 @@ decodeValue "date-local"     (lexValue -> Right (TokLocalDate      x)) = pure (T
 decodeValue "float"          (lexValue -> Right (TokFloat          x)) = pure (Toml.Double    x)
 decodeValue "float"          (lexValue -> Right (TokInteger        x)) = pure (Toml.Double    (fromInteger x))
 -- extra infinities as toml-tests are inconsistent
-decodeValue "float"          "+Inf"                                    = pure (Toml.Double    (1/0))
-decodeValue "float"          "-Inf"                                    = pure (Toml.Double    (-1/0))
+-- decodeValue "float"          "+Inf"                                    = pure (Toml.Double    (1/0))
+-- decodeValue "float"          "-Inf"                                    = pure (Toml.Double    (-1/0))
 decodeValue _                _                                         = empty

% toml-test ./TomlDecoder
toml-test v2023-12-07 [./TomlDecoder]: using embedded tests
  valid tests: 179 passed,  0 failed
invalid tests: 368 passed,  0 failed

% toml-test -encoder ./TomlEncoder
toml-test v2023-12-07 [./TomlEncoder]: using embedded tests
encoder tests: 179 passed,  0 failed

(I made sure to rebuild the TomlDecoder/TomlEncoder with the changes).

from toml-test.

arp242 avatar arp242 commented on September 28, 2024

Is this causing practical issues for you?

from toml-test.

Bowen7 avatar Bowen7 commented on September 28, 2024

I just wrote a parser for TOML for fun and found that it cannot pass these test suites.

from toml-test.

glguy avatar glguy commented on September 28, 2024

I had to add custom processing to my test program to account for the inconsistent way the test suite encodes infinities

https://github.com/glguy/toml-parser/blob/main/test-drivers/encoder/Main.hs#L59-L60

from toml-test.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.