Sha256: 1c81167939bb696b399a09979c3c4d88c65638b3c910e35e9cabc351d20405e3

Contents?: true

Size: 1.55 KB

Versions: 104

Compression:

Stored size: 1.55 KB

Contents

extern crate saddle_points;

use saddle_points::*;

#[test]
fn test_identify_single_saddle_point() {
    let input = vec![vec![9, 8, 7], vec![5, 3, 2], vec![6, 6, 7]];
    assert_eq!(vec![(1, 0)], find_saddle_points(&input));
}

#[test]
#[ignore]
fn test_identify_empty_matrix() {
    let input = vec![vec![], vec![], vec![]];
    let expected: Vec<(usize, usize)> = Vec::new();
    assert_eq!(expected, find_saddle_points(&input));
}

#[test]
#[ignore]
fn test_identify_lack_of_saddle_point() {
    let input = vec![vec![1, 2, 3], vec![3, 1, 2], vec![2, 3, 1]];
    let expected: Vec<(usize, usize)> = Vec::new();
    assert_eq!(expected, find_saddle_points(&input));
}

#[test]
#[ignore]
fn test_multiple_saddle_point() {
    let input = vec![vec![4, 5, 4], vec![3, 5, 5], vec![1, 5, 4]];
    assert_eq!(vec![(0, 1), (1, 1), (2, 1)], find_saddle_points(&input));
}

#[test]
#[ignore]
fn test_identify_bottom_right_saddle_point() {
    let input = vec![vec![8, 7, 9], vec![6, 7, 6], vec![3, 2, 5]];
    assert_eq!(vec![(2, 2)], find_saddle_points(&input));
}

#[test]
#[ignore]
fn test_non_square_matrix_high() {
    let input = vec![vec![1, 5], vec![3, 6], vec![2, 7], vec![3, 8]];
    assert_eq!(vec![(0, 1)], find_saddle_points(&input));
}

#[test]
#[ignore]
fn test_non_square_matrix_wide() {
    let input = vec![vec![8, 7, 10, 7, 9], vec![8, 7, 13, 7, 9]];
    assert_eq!(vec![(0, 2)], find_saddle_points(&input));
}

#[test]
#[ignore]
fn test_vector_matrix() {
    let input = vec![vec![1], vec![3], vec![2], vec![3]];
    assert_eq!(vec![(0, 0)], find_saddle_points(&input));
}

Version data entries

104 entries across 104 versions & 1 rubygems

Version Path
trackler-2.2.1.119 tracks/rust/exercises/saddle-points/tests/saddle-points.rs
trackler-2.2.1.118 tracks/rust/exercises/saddle-points/tests/saddle-points.rs
trackler-2.2.1.117 tracks/rust/exercises/saddle-points/tests/saddle-points.rs
trackler-2.2.1.116 tracks/rust/exercises/saddle-points/tests/saddle-points.rs
trackler-2.2.1.115 tracks/rust/exercises/saddle-points/tests/saddle-points.rs
trackler-2.2.1.114 tracks/rust/exercises/saddle-points/tests/saddle-points.rs
trackler-2.2.1.113 tracks/rust/exercises/saddle-points/tests/saddle-points.rs
trackler-2.2.1.111 tracks/rust/exercises/saddle-points/tests/saddle-points.rs
trackler-2.2.1.110 tracks/rust/exercises/saddle-points/tests/saddle-points.rs
trackler-2.2.1.109 tracks/rust/exercises/saddle-points/tests/saddle-points.rs
trackler-2.2.1.108 tracks/rust/exercises/saddle-points/tests/saddle-points.rs
trackler-2.2.1.107 tracks/rust/exercises/saddle-points/tests/saddle-points.rs
trackler-2.2.1.106 tracks/rust/exercises/saddle-points/tests/saddle-points.rs
trackler-2.2.1.105 tracks/rust/exercises/saddle-points/tests/saddle-points.rs
trackler-2.2.1.104 tracks/rust/exercises/saddle-points/tests/saddle-points.rs
trackler-2.2.1.103 tracks/rust/exercises/saddle-points/tests/saddle-points.rs
trackler-2.2.1.102 tracks/rust/exercises/saddle-points/tests/saddle-points.rs
trackler-2.2.1.101 tracks/rust/exercises/saddle-points/tests/saddle-points.rs
trackler-2.2.1.100 tracks/rust/exercises/saddle-points/tests/saddle-points.rs
trackler-2.2.1.99 tracks/rust/exercises/saddle-points/tests/saddle-points.rs