Sha256: 5fcbcb8daa541f8cd6cfdf916bd348b16c8c5aef602d8bcb00f347e2978d2580

Contents?: true

Size: 1019 Bytes

Versions: 202

Compression:

Stored size: 1019 Bytes

Contents

extern crate grains;

#[test]
fn square_one() {
    assert_eq!(grains::square(1), 1);
}

#[test]
#[ignore]
fn square_two() {
    assert_eq!(grains::square(2), 2);
}

#[test]
#[ignore]
fn square_three() {
    assert_eq!(grains::square(3), 4);
}

#[test]
#[ignore]
fn square_four() {
    assert_eq!(grains::square(4), 8);
}

#[test]
#[ignore]
fn square_sixteen() {
    assert_eq!(grains::square(16), 32_768);
}

#[test]
#[ignore]
fn square_thirty_two() {
    assert_eq!(grains::square(32), 2_147_483_648);
}

#[test]
#[ignore]
fn square_sixty_four() {
    assert_eq!(grains::square(64), 9_223_372_036_854_775_808);
}

#[test]
#[ignore]
#[should_panic(expected = "Square must be between 1 and 64")]
fn square_zero_panics() {
    grains::square(0);
}

#[test]
#[ignore]
#[should_panic(expected = "Square must be between 1 and 64")]
fn square_sixty_five_panics() {
    grains::square(65);
}

#[test]
#[ignore]
fn total_sums_all_squares() {
    assert_eq!(grains::total(), 18_446_744_073_709_551_615);
    grains::total();
}

Version data entries

202 entries across 202 versions & 1 rubygems

Version Path
trackler-2.2.0.3 tracks/rust/exercises/grains/tests/grains.rs
trackler-2.2.0.2 tracks/rust/exercises/grains/tests/grains.rs
trackler-2.2.0.1 tracks/rust/exercises/grains/tests/grains.rs
trackler-2.2.0.0 tracks/rust/exercises/grains/tests/grains.rs
trackler-2.1.0.55 tracks/rust/exercises/grains/tests/grains.rs
trackler-2.1.0.54 tracks/rust/exercises/grains/tests/grains.rs
trackler-2.1.0.53 tracks/rust/exercises/grains/tests/grains.rs
trackler-2.1.0.52 tracks/rust/exercises/grains/tests/grains.rs
trackler-2.1.0.51 tracks/rust/exercises/grains/tests/grains.rs
trackler-2.1.0.50 tracks/rust/exercises/grains/tests/grains.rs
trackler-2.1.0.49 tracks/rust/exercises/grains/tests/grains.rs
trackler-2.1.0.48 tracks/rust/exercises/grains/tests/grains.rs
trackler-2.1.0.47 tracks/rust/exercises/grains/tests/grains.rs
trackler-2.1.0.46 tracks/rust/exercises/grains/tests/grains.rs
trackler-2.1.0.45 tracks/rust/exercises/grains/tests/grains.rs
trackler-2.1.0.44 tracks/rust/exercises/grains/tests/grains.rs
trackler-2.1.0.43 tracks/rust/exercises/grains/tests/grains.rs
trackler-2.1.0.42 tracks/rust/exercises/grains/tests/grains.rs
trackler-2.1.0.41 tracks/rust/exercises/grains/tests/grains.rs
trackler-2.1.0.40 tracks/rust/exercises/grains/tests/grains.rs