Make number coercion behave more like Ruby#473
Make number coercion behave more like Ruby#473nbudin wants to merge 2 commits intocobalt-org:masterfrom
Conversation
|
Looks like this broke some other cases somehow. |
Ah yeah, I see that it did. I'll look into those and see if I can figure out what's up. |
…evious behavior and use them where we're assuming the strict behavior
|
@epage First off, sorry for breaking the tests! This is my first time working with a workspace project, and I didn't realize that simply running I've worked through all the test failures. It appears that a bunch of logic internal to the stdlib as well as the derive macros was assuming that an unparsable integer would come back as None. In order to keep compatibility with this logic, I've introduced |
liquid-rust doesn't quite behave like the Ruby implementation of Liquid when it comes to coercing other types into integers and floats.
There are three major differences I've found between Rust's behavior and Ruby's here, and I've tried to account for all of them in this PR:
Fixing these behaviors does constitute a breaking change for liquid-rust, since in order to fix them, I had to change several existing tests. I'm also not really sure that my approach to parsing floating-point number strings as integers is the best one possible - it feels a little hacky and perhaps there's a better way.