diff --git a/ChangeLog b/ChangeLog index 680b0bad17..3562ff8ea6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Tue Apr 13 23:00:55 2004 Masatoshi SEKI + + * lib/rinda/rinda.rb: change pattern matching. + a === b -> a == b || a === b. [druby-ja:98] + + * test/rinda/test_rinda.rb: ditto. + Tue Apr 13 21:50:57 2004 Nobuyoshi Nakada * bcc32/Makefile.sub (PHONY): Borland make disallows empty command diff --git a/lib/rinda/rinda.rb b/lib/rinda/rinda.rb index a977d5c525..37af34280a 100644 --- a/lib/rinda/rinda.rb +++ b/lib/rinda/rinda.rb @@ -105,7 +105,9 @@ module Rinda return false end next if v.nil? - return false unless (v === it) + next if v == it + next if v === it + return false end return true end diff --git a/test/rinda/test_rinda.rb b/test/rinda/test_rinda.rb index a87c66258c..684e44f4f1 100644 --- a/test/rinda/test_rinda.rb +++ b/test/rinda/test_rinda.rb @@ -26,11 +26,12 @@ module TupleSpaceTestModule assert(tmpl.match(['Rinda', 2, :hello])) assert(!tmpl.match(['Rinda', 2, Symbol])) assert(!tmpl.match([1, 2, :hello])) + assert(tmpl.match([/^rinda/i, nil, :hello])) tmpl = Rinda::Template.new([Symbol]) assert_equal(1, tmpl.size) assert(tmpl.match([:hello])) - assert(!tmpl.match([Symbol])) + assert(tmpl.match([Symbol])) assert(!tmpl.match(['Symbol'])) tmpl = Rinda::Template.new({"message"=>String, "name"=>String})