diff options
author | Jemma Issroff <[email protected]> | 2023-08-30 17:26:22 -0400 |
---|---|---|
committer | GitHub <[email protected]> | 2023-08-30 14:26:22 -0700 |
commit | f1790fa4e713f364bd6983586c0ba749e7b54968 (patch) | |
tree | 6c27b2f5c7d7ff1a9de5099bdc6ad0e54077f94e /test/yarp/compiler_test.rb | |
parent | 6599ca44bbaf9d1084638b392a46f1b3277212b9 (diff) |
[YARP] Fix variables in compilation (#8326)
* [YARP] Fixed several popped instructions
* [YARP] Correctly compiling class path
Notes
Notes:
Merged-By: jemmaissroff
Diffstat (limited to 'test/yarp/compiler_test.rb')
-rw-r--r-- | test/yarp/compiler_test.rb | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/test/yarp/compiler_test.rb b/test/yarp/compiler_test.rb index 88d0bddec7..bb1a1f47e8 100644 --- a/test/yarp/compiler_test.rb +++ b/test/yarp/compiler_test.rb @@ -50,7 +50,7 @@ module YARP ############################################################################ def test_ClassVariableReadNode - # assert_equal 1, compile("class YARP::CompilerTest; @@yct = 1; end; @@yct") + assert_equal 1, compile("class YARP::CompilerTest; @@yct = 1; @@yct; end") end def test_ConstantPathNode @@ -62,11 +62,11 @@ module YARP end def test_GlobalVariableReadNode - # assert_equal 1, compile("$yct = 1; $yct") + assert_equal 1, compile("$yct = 1; $yct") end def test_InstanceVariableReadNode - # assert_equal 1, compile("class YARP::CompilerTest; @yct = 1; @yct; end") + assert_equal 1, compile("class YARP::CompilerTest; @yct = 1; @yct; end") end ############################################################################ @@ -74,7 +74,7 @@ module YARP ############################################################################ def test_ClassVariableWriteNode - # assert_equal 1, compile("class YARP::CompilerTest; @@yct = 1; end") + assert_equal 1, compile("class YARP::CompilerTest; @@yct = 1; end") end def test_ConstantWriteNode @@ -90,7 +90,7 @@ module YARP end def test_InstanceVariableWriteNode - # assert_equal 1, compile("class YARP::CompilerTest; @yct = 1; end") + assert_equal 1, compile("class YARP::CompilerTest; @yct = 1; end") end ############################################################################ @@ -100,17 +100,17 @@ module YARP def test_EmbeddedVariableNode # assert_equal "1", compile('class YARP::CompilerTest; @yct = 1; "#@yct"; end') # assert_equal "1", compile('class YARP::CompilerTest; @@yct = 1; "#@@yct"; end') - # assert_equal "1", compile('$yct = 1; "#$yct"') + assert_equal "1", compile('$yct = 1; "#$yct"') end def test_InterpolatedStringNode - # assert_equal "1 1 1", compile('$yct = 1; "1 #$yct 1"') - # assert_equal "1 3 1", compile('"1 #{1 + 2} 1"') + assert_equal "1 1 1", compile('$yct = 1; "1 #$yct 1"') + assert_equal "1 3 1", compile('"1 #{1 + 2} 1"') end def test_InterpolatedSymbolNode - # assert_equal :"1 1 1", compile('$yct = 1; :"1 #$yct 1"') - # assert_equal :"1 3 1", compile(':"1 #{1 + 2} 1"') + assert_equal :"1 1 1", compile('$yct = 1; :"1 #$yct 1"') + assert_equal :"1 3 1", compile(':"1 #{1 + 2} 1"') end def test_StringConcatNode |