Skip to content

int::from_str isn't failing #2546

Closed
Closed
@jesse99

Description

@jesse99

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
            }
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions