Add logic to Duration::total to handle loss of precision#622
Conversation
Manishearth
left a comment
There was a problem hiding this comment.
Shouldn't be hard to just write the existing tests in Rust.
|
I have one already from another branch, but it has a bug and is creating the wrong expected value. So I need to clean it up a bit before adding it. |
5114180 to
a07f495
Compare
a07f495 to
4527b5d
Compare
|
I pushed a test that seems to work. I used the expected values from the JS tests that were failing. |
|
Ah, that will work. I was hoping to have a full version of the test262 test. But I'm not sure it's going to be possible without bringing in |
Wouldn't be a good test then IMO since that behavior itself could be buggy. |
It would be the best representation of the test262 test in Rust. But I don't necessarily disagree. In any case, we have at least a few engines running the test262 suite to help flag potential regressions. It would be nice to catch it in our tests. |
This adds the general logic from FractionToDouble to handle edge case Duration::total operations.
We still need to figure out a good way to test this in Rust, but all the Duration suite tests pass when ran locally in Boa.