File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1972,40 +1972,6 @@ def self.test_prism_call_node
19721972 end
19731973 test_prism_call_node
19741974 CODE
1975-
1976- # Test opt_str_freeze instruction when calling #freeze on a string literal
1977- assert_prism_eval ( <<~RUBY )
1978- "foo".freeze.equal?("foo".freeze)
1979- RUBY
1980- # Test encoding in opt_str_freeze
1981- assert_prism_eval ( <<~'RUBY' , raw : true )
1982- # -*- coding: us-ascii -*-
1983- "\xff".freeze.encoding
1984- RUBY
1985-
1986- # Test opt_aref_with instruction when calling [] with a string
1987- assert_prism_eval ( <<~RUBY )
1988- ObjectSpace.count_objects
1989-
1990- h = {"abc" => 1}
1991- before = ObjectSpace.count_objects[:T_STRING]
1992- 5.times{ h["abc"] }
1993- after = ObjectSpace.count_objects[:T_STRING]
1994-
1995- before == after
1996- RUBY
1997-
1998- # Test opt_aset_with instruction when calling []= with a string key
1999- assert_prism_eval ( <<~RUBY )
2000- ObjectSpace.count_objects
2001-
2002- h = {"abc" => 1}
2003- before = ObjectSpace.count_objects[:T_STRING]
2004- 5.times{ h["abc"] = 2}
2005- after = ObjectSpace.count_objects[:T_STRING]
2006-
2007- before == after
2008- RUBY
20091975 end
20101976
20111977 def test_CallAndWriteNode
You can’t perform that action at this time.
0 commit comments