Sha256: b581a1f4113b0631eae3906b6f3a61194011ad2e379852073241aa173875069d

Contents?: true

Size: 910 Bytes

Versions: 268

Compression:

Stored size: 910 Bytes

Contents

extern crate pascals_triangle;

use pascals_triangle::*;

#[test]
fn no_rows() {
    let pt = PascalsTriangle::new(0);
    let expected: Vec<Vec<u32>> = Vec::new();
    assert_eq!(expected, pt.rows());
}

#[test]
#[ignore]
fn one_row() {
    let pt = PascalsTriangle::new(1);
    let expected: Vec<Vec<u32>> = vec![vec![1]];
    assert_eq!(expected, pt.rows());
}

#[test]
#[ignore]
fn two_rows() {
    let pt = PascalsTriangle::new(2);
    let expected: Vec<Vec<u32>> = vec![vec![1], vec![1, 1]];
    assert_eq!(expected, pt.rows());
}

#[test]
#[ignore]
fn three_rows() {
    let pt = PascalsTriangle::new(3);
    let expected: Vec<Vec<u32>> = vec![vec![1], vec![1, 1], vec![1, 2, 1]];
    assert_eq!(expected, pt.rows());
}

#[test]
#[ignore]
fn last_of_four_rows() {
    let pt = PascalsTriangle::new(4);
    let expected: Vec<u32> = vec![1, 3, 3, 1];
    assert_eq!(expected, pt.rows().pop().unwrap());
}

Version data entries

268 entries across 268 versions & 1 rubygems

Version Path
trackler-2.2.1.50 tracks/rust/exercises/pascals-triangle/tests/pascals-triangle.rs
trackler-2.2.1.49 tracks/rust/exercises/pascals-triangle/tests/pascals-triangle.rs
trackler-2.2.1.48 tracks/rust/exercises/pascals-triangle/tests/pascals-triangle.rs
trackler-2.2.1.47 tracks/rust/exercises/pascals-triangle/tests/pascals-triangle.rs
trackler-2.2.1.46 tracks/rust/exercises/pascals-triangle/tests/pascals-triangle.rs
trackler-2.2.1.45 tracks/rust/exercises/pascals-triangle/tests/pascals-triangle.rs
trackler-2.2.1.44 tracks/rust/exercises/pascals-triangle/tests/pascals-triangle.rs
trackler-2.2.1.43 tracks/rust/exercises/pascals-triangle/tests/pascals-triangle.rs
trackler-2.2.1.42 tracks/rust/exercises/pascals-triangle/tests/pascals-triangle.rs
trackler-2.2.1.41 tracks/rust/exercises/pascals-triangle/tests/pascals-triangle.rs
trackler-2.2.1.40 tracks/rust/exercises/pascals-triangle/tests/pascals-triangle.rs
trackler-2.2.1.39 tracks/rust/exercises/pascals-triangle/tests/pascals-triangle.rs
trackler-2.2.1.38 tracks/rust/exercises/pascals-triangle/tests/pascals-triangle.rs
trackler-2.2.1.37 tracks/rust/exercises/pascals-triangle/tests/pascals-triangle.rs
trackler-2.2.1.36 tracks/rust/exercises/pascals-triangle/tests/pascals-triangle.rs
trackler-2.2.1.35 tracks/rust/exercises/pascals-triangle/tests/pascals-triangle.rs
trackler-2.2.1.34 tracks/rust/exercises/pascals-triangle/tests/pascals-triangle.rs
trackler-2.2.1.33 tracks/rust/exercises/pascals-triangle/tests/pascals-triangle.rs
trackler-2.2.1.32 tracks/rust/exercises/pascals-triangle/tests/pascals-triangle.rs
trackler-2.2.1.31 tracks/rust/exercises/pascals-triangle/tests/pascals-triangle.rs