aboutsummaryrefslogtreecommitdiffstats
path: root/test/mkmf
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-02-07 06:33:22 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-02-07 06:33:22 +0000
commit13b11810e289bc7b946e9c6eac7d1348107f0eda (patch)
treecab8d83ecc9d3b829531565d31b2f9d1febb5e5c /test/mkmf
parentfd0c338df7348b7a482f0fc135505aade7908933 (diff)
downloadruby-13b11810e289bc7b946e9c6eac7d1348107f0eda.tar.gz
mkmf.rb: fix merge_libs
* lib/mkmf.rb (MakeMakefile#merge_libs): insert following reversal ordered elements just after the duplicated element, not overwriting successive elements. [ruby-core:50314] [Bug #7467] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/mkmf')
-rw-r--r--test/mkmf/test_libs.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/mkmf/test_libs.rb b/test/mkmf/test_libs.rb
index 67722afa67..27674dfd26 100644
--- a/test/mkmf/test_libs.rb
+++ b/test/mkmf/test_libs.rb
@@ -65,5 +65,22 @@ class TestMkmf
assert_in_order(array, "c", "d" , bug)
## assume that a and c have no dependency
end
+
+ def test_merge_reversal_followed
+ bug7467 = '[ruby-core:50314] [Bug #7467]'
+ array = nil
+ assert_nothing_raised(bug7467) {
+ array = merge_libs(%w[a b c d e f g h], %w[d c d e], [])
+ }
+ assert_in_order(array, "a", "b", bug7467)
+ assert_in_order(array, "b", "c", bug7467)
+ assert_in_order(array, "c", "d", bug7467)
+ assert_in_order(array, "d", "e", bug7467)
+ assert_in_order(array, "e", "f", bug7467)
+ assert_in_order(array, "f", "g", bug7467)
+ assert_in_order(array, "g", "h", bug7467)
+ assert_in_order(array, "d", "c", bug7467)
+ assert_in_order(array, "c", "e", bug7467)
+ end
end
end if RUBY_ENGINE == "ruby"