You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
258 B
15 lines
258 B
13 years ago
|
require 'test/unit'
|
||
13 years ago
|
require 'sorting'
|
||
|
|
||
|
|
||
13 years ago
|
class TestSorting < Test::Unit::TestCase
|
||
|
def test_insertion_sort
|
||
|
tmpl = [8, 2, 4, 9, 3, 6]
|
||
|
a = Array.new(tmpl)
|
||
|
expected = [2, 3, 4, 6, 8, 9]
|
||
13 years ago
|
|
||
13 years ago
|
insertion_sort(a)
|
||
|
assert_equal(expected, a)
|
||
13 years ago
|
end
|
||
|
end
|