Skip to content

int::from_str isn't failing #2546

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

Closed
jesse99 opened this issue Jun 8, 2012 · 1 comment
Closed

int::from_str isn't failing #2546

jesse99 opened this issue Jun 8, 2012 · 1 comment

Comments

@jesse99
Copy link
Contributor

jesse99 commented Jun 8, 2012

The following unit tests all fail:


// rustc --test from_str.rs && ./from_str
use std;

#[test]
fn too_big()
{
    alt int::from_str("9999999999999999999999")
    {
            option::some(value)
            {
                io::println(#fmt["How did we get %??\n", value]);
                assert false;
            }
            option::none()
            {
                // passed
            }
    }
}

#[test]
fn too_small()
{
    alt int::from_str("-9999999999999999999999")
    {
            option::some(value)
            {
                io::println(#fmt["How did we get %??\n", value]);
                assert false;
            }
            option::none()
            {
                // passed
            }
    }
}
@yjh0502
Copy link
Contributor

yjh0502 commented Mar 5, 2013

This issue is already solved, and tests are already written.
https://github.com/mozilla/rust/blob/master/src/libcore/num/int-template.rs#L363

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

3 participants