Skip to content

Commit

Permalink
Introduce ambiguity in Hamming problem.
Browse files Browse the repository at this point in the history
This removes the tests that define behavior for cases where the strings are of unequal
length. Since the hamming problem is the first one on the Ruby track, and so many people
who are new to programming start with the Ruby track, I didn't want to introduce error
handling here.

The wikipedia article about the Hamming distance says that the behavior is undefined if
the strings are of unequal length. I don't necessarily think that this means that a particular
implementation _shouldn't_ specify an error, only that it's OK to leave it undefined.

This will also make it possible to bring up the idea of edge cases and error handling in the
discussions on the site.

Closes #44 and #31.
  • Loading branch information
kytrinyx committed Nov 24, 2014
1 parent 6d35f98 commit 3cbd1b5
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions hamming/hamming_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,6 @@ def test_small_hamming_distance_in_longer_strand
assert_equal 1, Hamming.compute('GGACG', 'GGTCG')
end

def test_ignores_extra_length_on_first_strand_when_longer
skip
assert_equal 1, Hamming.compute('AGAGACTTA', 'AAA')
end

def test_ignores_extra_length_on_other_strand_when_longer
skip
assert_equal 2, Hamming.compute('AGG', 'AAAACTGACCCACCCCAGG')
end

def test_large_hamming_distance
skip
assert_equal 4, Hamming.compute('GATACA', 'GCATAA')
Expand Down

0 comments on commit 3cbd1b5

Please sign in to comment.