[Rubytests-commit] rubicon/builtin TestSymbol.rb

holmberg at rubyforge.org holmberg at rubyforge.org
Thu Aug 11 08:42:20 EDT 2005


Update of /var/cvs/rubytests/rubicon/builtin
In directory rubyforge.org:/tmp/cvs-serv24335

Modified Files:
	TestSymbol.rb 
Log Message:
Added tests of Symbol#inspect.
String#intern is used to create symbols with different "content"
( e.g. with spaces, and special characters like " and \ ).


Index: TestSymbol.rb
===================================================================
RCS file: /var/cvs/rubytests/rubicon/builtin/TestSymbol.rb,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** TestSymbol.rb	11 Aug 2005 12:07:41 -0000	1.4
--- TestSymbol.rb	11 Aug 2005 12:42:18 -0000	1.5
***************
*** 33,36 ****
--- 33,43 ----
    end
  
+   def test_inspect
+     assert_equal(':hello', 'hello'.intern.inspect)
+     assert_equal(':"hello world"', 'hello world'.intern.inspect)
+     assert_equal(':"with \" char"', 'with " char'.intern.inspect)
+     assert_equal(':"with \\\\ \" chars"', 'with \ " chars'.intern.inspect)
+   end
+ 
    def test_to_i
      assert_equal($f1.to_i,$f2.to_i)



More information about the Rubytests-commit mailing list