summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorKevin Newton <kddnewton@gmail.com>2023-09-13 15:06:50 -0400
committergit <svn-admin@ruby-lang.org>2023-09-14 18:30:11 +0000
commit826bebb7d89928690334b632ef54d5c0edf73189 (patch)
tree85d3dfd4acd5ef8b69d5c573db8da1fc7a9d49a2 /test
parent7f6cf2d283621fc10994b377037522e1146645c6 (diff)
[ruby/yarp] Reject invalid call-operator-write
https://github.com/ruby/yarp/commit/d3a852dac2
Diffstat (limited to 'test')
-rw-r--r--test/yarp/errors_test.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/yarp/errors_test.rb b/test/yarp/errors_test.rb
index 1285ba75cd..09abe3ee79 100644
--- a/test/yarp/errors_test.rb
+++ b/test/yarp/errors_test.rb
@@ -1137,13 +1137,20 @@ module YARP
assert_errors expected, "def foo(a = 1,b,*c);end", [["Unexpected parameter `*`", 16..17]]
end
- def test_invalid_operator_write
+ def test_invalid_operator_write_fcall
source = "foo! += 1"
assert_errors expression(source), source, [
["Unexpected write target", 0..4]
]
end
+ def test_invalid_operator_write_dot
+ source = "foo.+= 1"
+ assert_errors expression(source), source, [
+ ["Unexpected write target", 5..6]
+ ]
+ end
+
def test_unterminated_global_variable
assert_errors expression("$"), "$", [
["Invalid global variable", 0..1]