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