From fbcacf6388bbe19970f2793aa7f42b2fc7254a9b Mon Sep 17 00:00:00 2001 From: matz Date: Fri, 29 Jun 2007 06:27:49 +0000 Subject: * parse.y (assoc_list): remove expanded hash literal (no splat). * lib/webrick/httpstatus.rb (WEBrick::HTTPStatus::EOFError): adapt to new syntax. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@12658 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- sample/test.rb | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'sample') diff --git a/sample/test.rb b/sample/test.rb index 18c914d5b..bda0d1837 100644 --- a/sample/test.rb +++ b/sample/test.rb @@ -750,12 +750,11 @@ test_ok($x == [1,2,3,1,2,3]) test_check "hash" $x = {1=>2, 2=>4, 3=>6} -$y = {1, 2, 2, 4, 3, 6} test_ok($x[1] == 2) test_ok(begin - for k,v in $y + for k,v in $x raise if k*2 != v end true @@ -769,19 +768,19 @@ test_ok($x.has_value?(4)) test_ok($x.values_at(2,3) == [4,6]) test_ok($x == {1=>2, 2=>4, 3=>6}) -$z = $y.keys.sort.join(":") +$z = $x.keys.sort.join(":") test_ok($z == "1:2:3") -$z = $y.values.sort.join(":") +$z = $x.values.sort.join(":") test_ok($z == "2:4:6") -test_ok($x == $y) +test_ok($x == $x) -$y.shift -test_ok($y.length == 2) +$x.shift +test_ok($x.length == 2) $z = [1,2] -$y[$z] = 256 -test_ok($y[$z] == 256) +$x[$z] = 256 +test_ok($x[$z] == 256) $x = Hash.new(0) $x[1] = 1 -- cgit