Skip to content

hamming: Updated the exercise to the 2.2.0 version #775

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion exercises/hamming/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[package]
name = "hamming"
version = "2.1.1"
version = "2.2.0"
96 changes: 20 additions & 76 deletions exercises/hamming/tests/hamming.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,16 @@ fn test_empty_strands() {

#[test]
#[ignore]
fn test_no_difference_between_identical_strands() {
process_distance_case(["GGACTGA", "GGACTGA"], Some(0));
}

#[test]
#[ignore]
fn test_complete_hamming_distance_in_small_strand() {
process_distance_case(["ACT", "GGA"], Some(3));
}

#[test]
#[ignore]
fn test_small_hamming_distance_in_the_middle_somewhere() {
process_distance_case(["GGACG", "GGTCG"], Some(1));
/// disallow first strand longer
fn test_disallow_first_strand_longer() {
process_distance_case(["AATG", "AAA"], None);
}

#[test]
#[ignore]
fn test_larger_distance() {
process_distance_case(["ACCAGGG", "ACTATGG"], Some(2));
/// disallow second strand longer
fn test_disallow_second_strand_longer() {
process_distance_case(["ATA", "AGTG"], None);
}

#[test]
Expand All @@ -50,98 +40,52 @@ fn test_second_string_is_longer() {

#[test]
#[ignore]
/// non-unique character in first strand
fn test_nonunique_character_in_first_strand() {
process_distance_case(["AAG", "AAA"], Some(1));
}

#[test]
#[ignore]
/// identical strands
fn test_identical_strands() {
/// single letter identical strands
fn test_single_letter_identical_strands() {
process_distance_case(["A", "A"], Some(0));
}

#[test]
#[ignore]
/// complete distance in small strands
fn test_complete_distance_in_small_strands() {
process_distance_case(["AG", "CT"], Some(2));
}

#[test]
#[ignore]
/// disallow first strand longer
fn test_disallow_first_strand_longer() {
process_distance_case(["AATG", "AAA"], None);
}

#[test]
#[ignore]
/// large distance
fn test_large_distance() {
process_distance_case(["GATACA", "GCATAA"], Some(4));
/// small distance
fn test_single_letter_different_strands() {
process_distance_case(["G", "T"], Some(1));
}

#[test]
#[ignore]
/// long identical strands
fn test_long_identical_strands() {
process_distance_case(["GGACTGA", "GGACTGA"], Some(0));
process_distance_case(["GGACTGAAATCTG", "GGACTGAAATCTG"], Some(0));
}

#[test]
#[ignore]
/// complete distance in single nucleotide strands
fn test_complete_distance_in_single_nucleotide_strands() {
process_distance_case(["A", "G"], Some(1));
fn test_no_difference_between_identical_strands() {
process_distance_case(["GGACTGA", "GGACTGA"], Some(0));
}

#[test]
#[ignore]
/// small distance
fn test_small_distance() {
process_distance_case(["GGACG", "GGTCG"], Some(1));
fn test_complete_hamming_distance_in_small_strand() {
process_distance_case(["ACT", "GGA"], Some(3));
}

#[test]
#[ignore]
/// non-unique character in second strand
fn test_nonunique_character_in_second_strand() {
process_distance_case(["AAA", "AAG"], Some(1));
fn test_small_hamming_distance_in_the_middle_somewhere() {
process_distance_case(["GGACG", "GGTCG"], Some(1));
}

#[test]
#[ignore]
/// small distance in long strands
fn test_small_distance_in_long_strands() {
fn test_larger_distance() {
process_distance_case(["ACCAGGG", "ACTATGG"], Some(2));
}

#[test]
#[ignore]
/// disallow second strand longer
fn test_disallow_second_strand_longer() {
process_distance_case(["ATA", "AGTG"], None);
}

#[test]
#[ignore]
/// small distance in small strands
fn test_small_distance_in_small_strands() {
process_distance_case(["AT", "CT"], Some(1));
}

#[test]
#[ignore]
/// large distance in off-by-one strand
fn test_large_distance_in_offbyone_strand() {
fn test_long_different_strands() {
process_distance_case(["GGACGGATTCTG", "AGGACGGATTCT"], Some(9));
}

#[test]
#[ignore]
/// same nucleotides in different positions
fn test_same_nucleotides_in_different_positions() {
process_distance_case(["TAG", "GAT"], Some(2));
}