Merge branch 'tamuratak-fix_typo_ruby_unordered_map'
* tamuratak-fix_typo_ruby_unordered_map: [ruby] add a test to make sure that std::multiset is including Enumerable. [ruyb] enable std::list test for Ruby. [ruby] make std::list include Enumerable. [ruby] make std::multiset and std::unordered_multiset include Enumerable. tests added. [ruby] make std::unordered_map include Enumerable.
This commit is contained in:
commit
382b3f0f8c
7 changed files with 32 additions and 3 deletions
|
|
@ -14,6 +14,7 @@ CPP_TEST_CASES = \
|
|||
li_cstring \
|
||||
li_factory \
|
||||
li_std_functors \
|
||||
li_std_list \
|
||||
li_std_multimap \
|
||||
li_std_pair_lang_object \
|
||||
li_std_queue \
|
||||
|
|
|
|||
|
|
@ -5,6 +5,9 @@ require 'cpp11_hash_tables'
|
|||
Cpp11_hash_tables::MultiMapIntInt.new({1=>7}),
|
||||
Cpp11_hash_tables::UnorderedMapIntInt.new({1=>7}),
|
||||
Cpp11_hash_tables::UnorderedMultiMapIntInt.new({1=>7})].each{|x|
|
||||
|
||||
swig_assert_equal("x.find_all{|e,k| e == 1}", "[[1,7]]", binding)
|
||||
|
||||
swig_assert_equal("x[1]", "7", binding)
|
||||
swig_assert_equal("x[2]", "nil", binding)
|
||||
x[2] = 9
|
||||
|
|
@ -27,6 +30,9 @@ require 'cpp11_hash_tables'
|
|||
Cpp11_hash_tables::MultiSetInt.new([1]),
|
||||
Cpp11_hash_tables::UnorderedSetInt.new([1]),
|
||||
Cpp11_hash_tables::UnorderedMultiSetInt.new([1])].each{|x|
|
||||
|
||||
swig_assert_equal("x.find_all{|e| e == 1}", "[1]", binding)
|
||||
|
||||
swig_assert_equal("x.include?(1)", "true", binding)
|
||||
swig_assert_equal("x.include?(2)", "false", binding)
|
||||
x << 2
|
||||
|
|
@ -42,3 +48,14 @@ require 'cpp11_hash_tables'
|
|||
x << 1
|
||||
swig_assert_equal("x.count(1)", "2", binding)
|
||||
}
|
||||
|
||||
[Cpp11_hash_tables::MapIntInt,
|
||||
Cpp11_hash_tables::MultiMapIntInt,
|
||||
Cpp11_hash_tables::UnorderedMapIntInt,
|
||||
Cpp11_hash_tables::UnorderedMultiMapIntInt,
|
||||
Cpp11_hash_tables::SetInt,
|
||||
Cpp11_hash_tables::MultiSetInt,
|
||||
Cpp11_hash_tables::UnorderedSetInt,
|
||||
Cpp11_hash_tables::UnorderedMultiSetInt].each{|k|
|
||||
swig_assert("k.include?(Enumerable)", binding)
|
||||
}
|
||||
|
|
|
|||
8
Examples/test-suite/ruby/li_std_list_runme.rb
Normal file
8
Examples/test-suite/ruby/li_std_list_runme.rb
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
require 'swig_assert'
|
||||
|
||||
require 'li_std_list'
|
||||
|
||||
include Li_std_list
|
||||
|
||||
x = DoubleList.new([1,2,3])
|
||||
swig_assert_equal("[1.0]", "x.find_all{|e| e == 1 }", binding)
|
||||
Loading…
Add table
Add a link
Reference in a new issue