Sha256: 137aa627239fa304e6874181b9a81c3d194acbf459fe3edd009a5c45038ed1d5

Contents?: true

Size: 937 Bytes

Versions: 29

Compression:

Stored size: 937 Bytes

Contents

extern crate hamming;

#[test]
fn test_no_difference_between_empty_strands() {
    assert_eq!(hamming::hamming_distance("", ""), Some(0));
}

#[test]
#[ignore]
fn test_no_difference_between_identical_strands() {
    assert_eq!(hamming::hamming_distance("GGACTGA", "GGACTGA"), Some(0));
}

#[test]
#[ignore]
fn test_complete_hamming_distance_in_small_strand() {
    assert_eq!(hamming::hamming_distance("ACT", "GGA"), Some(3));
}

#[test]
#[ignore]
fn test_small_hamming_distance_in_the_middle_somewhere() {
    assert_eq!(hamming::hamming_distance("GGACG", "GGTCG"), Some(1));
}

#[test]
#[ignore]
fn test_larger_distance() {
    assert_eq!(hamming::hamming_distance("ACCAGGG", "ACTATGG"), Some(2));
}

#[test]
#[ignore]
fn test_first_string_is_longer() {
    assert_eq!(hamming::hamming_distance("AAA", "AA"), None);
}

#[test]
#[ignore]
fn test_second_string_is_longer() {
    assert_eq!(hamming::hamming_distance("A", "AA"), None);
}

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/rust/exercises/hamming/tests/hamming.rs
trackler-2.2.1.179 tracks/rust/exercises/hamming/tests/hamming.rs
trackler-2.2.1.178 tracks/rust/exercises/hamming/tests/hamming.rs
trackler-2.2.1.177 tracks/rust/exercises/hamming/tests/hamming.rs
trackler-2.2.1.176 tracks/rust/exercises/hamming/tests/hamming.rs
trackler-2.2.1.175 tracks/rust/exercises/hamming/tests/hamming.rs
trackler-2.2.1.174 tracks/rust/exercises/hamming/tests/hamming.rs
trackler-2.2.1.173 tracks/rust/exercises/hamming/tests/hamming.rs
trackler-2.2.1.172 tracks/rust/exercises/hamming/tests/hamming.rs
trackler-2.2.1.171 tracks/rust/exercises/hamming/tests/hamming.rs
trackler-2.2.1.170 tracks/rust/exercises/hamming/tests/hamming.rs
trackler-2.2.1.169 tracks/rust/exercises/hamming/tests/hamming.rs
trackler-2.2.1.167 tracks/rust/exercises/hamming/tests/hamming.rs
trackler-2.2.1.166 tracks/rust/exercises/hamming/tests/hamming.rs
trackler-2.2.1.165 tracks/rust/exercises/hamming/tests/hamming.rs
trackler-2.2.1.164 tracks/rust/exercises/hamming/tests/hamming.rs
trackler-2.2.1.163 tracks/rust/exercises/hamming/tests/hamming.rs
trackler-2.2.1.162 tracks/rust/exercises/hamming/tests/hamming.rs
trackler-2.2.1.161 tracks/rust/exercises/hamming/tests/hamming.rs
trackler-2.2.1.160 tracks/rust/exercises/hamming/tests/hamming.rs