my-solutions/problems/14-longest-common-prefix/test.rb

19 lines
372 B
Ruby
Raw Normal View History

2022-11-26 11:27:25 +05:00
require_relative "main"
require "test/unit"
class TestLCP < Test::Unit::TestCase
def test_simple
assert_equal("fl", longest_common_prefix(["flower","flow","flight"]) )
end
def test_empty_prefix
assert_equal("", longest_common_prefix(["dog","racecar","car"]) )
end
def test_empty_string
assert_equal("", longest_common_prefix([""]) )
end
end