⚲
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
Ruby master
All Projects
Ruby
»
Ruby master
Overview
Activity
Roadmap
Issues
Repository
Like
Download (1.05 KB)
Feature #8956
» hash-test.rb
adamdunson (Addie Drake)
, 09/26/2013 11:54 PM
require
'pp'
puts
"Testing: no commas (new syntax)"
some_hash
=
{
:foo
=>
'bar'
:bar
=>
'foo'
:baz
=>
{
:foo
=>
'bar'
+
'baz'
:bar
=>
'foo'
:qux
=>
'quux'
:corge
=>
'grault'
}
}
PP
.
pp
some_hash
puts
puts
"Testing: no commas (new syntax) as argument"
PP
.
pp
({
:foo
=>
'bar'
:bar
=>
'foo'
:baz
=>
{
:foo
=>
'bar'
+
'baz'
:bar
=>
'foo'
:qux
=>
'quux'
:corge
=>
'grault'
}
})
puts
puts
"Testing: no commas (new syntax) as argument"
PP
.
pp
({
:foo
=>
'bar'
:bar
=>
'foo'
:baz
=>
{
:foo
=>
'bar'
+
'baz'
:bar
=>
'foo'
:qux
=>
'quux'
:corge
=>
'grault'
}
})
puts
puts
"Testing: commas (old syntax)"
some_hash
=
{
:foo
=>
'bar'
,
:bar
=>
'foo'
,
:baz
=>
{
:foo
=>
'bar'
+
'baz'
,
:bar
=>
'foo'
,
:qux
=>
'quux'
,
:corge
=>
'grault'
}
}
PP
.
pp
some_hash
puts
puts
"Testing: mixed commas (old syntax) and no commas (new syntax)"
some_hash
=
{
:foo
=>
'bar'
:bar
=>
'foo'
,
:baz
=>
{
:foo
=>
'bar'
+
'baz'
,
:bar
=>
'foo'
,
:qux
=>
'quux'
,
:corge
=>
'grault'
},
}
PP
.
pp
some_hash
« Previous
1
2
3
4
…
7
Next »
(2-2/7)
Loading...