diff options
author | Takashi Tamura <tamuratak@users.noreply.github.com> | 2017-02-24 16:58:34 +0900 |
---|---|---|
committer | Takashi Tamura <tamuratak@users.noreply.github.com> | 2017-02-24 16:59:17 +0900 |
commit | 9f4308278637e181bd4aa64e2afcc2e0d50031e2 (patch) | |
tree | 0c4b012fe6333225522cfd1668da2cc405b7248f /Examples | |
parent | 005e129287766330f3e2823e8f9902dc9232ebbc (diff) | |
download | swig-9f4308278637e181bd4aa64e2afcc2e0d50031e2.tar.gz |
[ruby] make std::multiset and std::unordered_multiset include Enumerable. tests added.
Diffstat (limited to 'Examples')
-rw-r--r-- | Examples/test-suite/ruby/cpp11_hash_tables_runme.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Examples/test-suite/ruby/cpp11_hash_tables_runme.rb b/Examples/test-suite/ruby/cpp11_hash_tables_runme.rb index db910505e..a7b384692 100644 --- a/Examples/test-suite/ruby/cpp11_hash_tables_runme.rb +++ b/Examples/test-suite/ruby/cpp11_hash_tables_runme.rb @@ -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,13 @@ 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::UnorderedSetInt, + Cpp11_hash_tables::UnorderedMultiSetInt].each{|k| + swig_assert("k.include?(Enumerable)", binding) +} |