diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/yarp/compiler_test.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/yarp/compiler_test.rb b/test/yarp/compiler_test.rb index f7f8618ada..ea8c390362 100644 --- a/test/yarp/compiler_test.rb +++ b/test/yarp/compiler_test.rb @@ -168,6 +168,12 @@ module YARP assert_equal "1", compile('$yct = 1; "#$yct"') end + def test_InterpolatedRegularExpressionNode + assert_equal /1 1 1/, compile('$yct = 1; /1 #$yct 1/') + assert_equal /1 3 1/, compile('/1 #{1 + 2} 1/') + assert_equal /1 2 3 1/, compile('/1 #{"2"} #{1 + 2} 1/') + 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"') @@ -183,6 +189,10 @@ module YARP assert_equal "100", compile('`printf "100"`') end + def test_RegularExpressionNode + assert_equal /yct/, compile('/yct/') + end + def test_StringConcatNode # assert_equal "YARP::CompilerTest", compile('"YARP" "::" "CompilerTest"') end |
