-
-
Save snoozer05/86b838fdb2a333f86392b36a9184709f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 複数の文字列から前方一致部分の文字列を取り出す | |
def forward_match(strs) | |
#TODO | |
end | |
# ruby forward_match.rb | |
if $0 == __FILE__ | |
require 'minitest/autorun' | |
class ForwardMatchTest < Minitest::Test | |
def test_simple_forward_match_array_size_is_two | |
assert_equal 'abcd', forward_match(['abcdef', 'abcdxyz']) | |
end | |
def test_simple_forward_match_array_size_is_three | |
assert_equal 'abc', forward_match(['abcdef', 'abcdxyz', 'abcABC']) | |
end | |
def test_complex_forward_match_array_size_is_two | |
assert_equal 'abcd', forward_match(['abcdef', 'abcdxfz']) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment