Core: String.toInt "0x" == Ok NaN

Created on 7 Mar 2018  路  4Comments  路  Source: elm/core

Full list of edge-cases:

https://ellie-app.com/R9mPnktLa1/0

Current problematic

| Expression | 0.18 | master |
|---------------------|----------|------------|
| String.toInt "0x" | Ok NaN | Just NaN |

Fixed on master

| Expression | 0.18 | master |
|--------------------|----------|------------|
| String.toInt "+" | Ok NaN | Nothing |
| String.toInt "-" | Ok NaN | Nothing |


Edge-cases that behave correctly

| Expression | 0.18 | master |
|---------------------|-------------|------------|
| String.toInt "0X" | Err "..." | Nothing |
| String.toInt "0o" | Err "..." | Nothing |
| String.toInt "0O" | Err "..." | Nothing |
| String.toInt "0b" | Err "..." | Nothing |
| String.toInt "0B" | Err "..." | Nothing |

bug

Most helpful comment

These all give me Nothing on 0.19; I can't reproduce any of them anymore!

All 4 comments

Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

Do you mind filling in the ??? in each case? I do not understand the headers right now, but I'll get the issue if these become Err ... and Ok NaN and Ok 0 or whatever else.

Swapped thing around so the actual issue is on top, with output from 0.18 and the changes on the master branch included. Does this work better for you?

These all give me Nothing on 0.19; I can't reproduce any of them anymore!

Was this page helpful?
0 / 5 - 0 ratings