mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	change pattern matching [druby-ja:98]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6154 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
		
							parent
							
								
									e022b74520
								
							
						
					
					
						commit
						dae0bfcf37
					
				
					 3 changed files with 12 additions and 2 deletions
				
			
		| 
						 | 
					@ -1,3 +1,10 @@
 | 
				
			||||||
 | 
					Tue Apr 13 23:00:55 2004  Masatoshi SEKI  <m_seki@mva.biglobe.ne.jp>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						* 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  <nobu@ruby-lang.org>
 | 
					Tue Apr 13 21:50:57 2004  Nobuyoshi Nakada  <nobu@ruby-lang.org>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	* bcc32/Makefile.sub (PHONY): Borland make disallows empty command
 | 
						* bcc32/Makefile.sub (PHONY): Borland make disallows empty command
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -105,7 +105,9 @@ module Rinda
 | 
				
			||||||
          return false
 | 
					          return false
 | 
				
			||||||
        end
 | 
					        end
 | 
				
			||||||
	next if v.nil?
 | 
						next if v.nil?
 | 
				
			||||||
	return false unless (v === it)
 | 
					        next if v == it
 | 
				
			||||||
 | 
					        next if v === it
 | 
				
			||||||
 | 
						return false
 | 
				
			||||||
      end
 | 
					      end
 | 
				
			||||||
      return true
 | 
					      return true
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -26,11 +26,12 @@ module TupleSpaceTestModule
 | 
				
			||||||
    assert(tmpl.match(['Rinda', 2, :hello]))
 | 
					    assert(tmpl.match(['Rinda', 2, :hello]))
 | 
				
			||||||
    assert(!tmpl.match(['Rinda', 2, Symbol]))
 | 
					    assert(!tmpl.match(['Rinda', 2, Symbol]))
 | 
				
			||||||
    assert(!tmpl.match([1, 2, :hello]))
 | 
					    assert(!tmpl.match([1, 2, :hello]))
 | 
				
			||||||
 | 
					    assert(tmpl.match([/^rinda/i, nil, :hello]))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    tmpl = Rinda::Template.new([Symbol])
 | 
					    tmpl = Rinda::Template.new([Symbol])
 | 
				
			||||||
    assert_equal(1, tmpl.size)
 | 
					    assert_equal(1, tmpl.size)
 | 
				
			||||||
    assert(tmpl.match([:hello]))
 | 
					    assert(tmpl.match([:hello]))
 | 
				
			||||||
    assert(!tmpl.match([Symbol]))
 | 
					    assert(tmpl.match([Symbol]))
 | 
				
			||||||
    assert(!tmpl.match(['Symbol']))
 | 
					    assert(!tmpl.match(['Symbol']))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    tmpl = Rinda::Template.new({"message"=>String, "name"=>String})
 | 
					    tmpl = Rinda::Template.new({"message"=>String, "name"=>String})
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue