aboutsummaryrefslogtreecommitdiffstats
path: root/test/prism/errors_test.rb
diff options
context:
space:
mode:
authorHaldun Bayhantopcu <haldun@github.com>2023-09-27 20:24:19 +0200
committergit <svn-admin@ruby-lang.org>2023-09-28 13:31:22 +0000
commit7799fe90da49958af0d33d18c82f12012610f32a (patch)
tree8c98f0749b042432eadbfa62275444cfc80e673a /test/prism/errors_test.rb
parent0084bac47a49d787a86c4cfd4d238c24736eb659 (diff)
downloadruby-7799fe90da49958af0d33d18c82f12012610f32a.tar.gz
[ruby/prism] Check for a semicolon or a newline after the inheritance operator
https://github.com/ruby/prism/commit/0326ba6775
Diffstat (limited to 'test/prism/errors_test.rb')
-rw-r--r--test/prism/errors_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/prism/errors_test.rb b/test/prism/errors_test.rb
index 1975a17102..372e7791db 100644
--- a/test/prism/errors_test.rb
+++ b/test/prism/errors_test.rb
@@ -1355,6 +1355,13 @@ module Prism
]
end
+ def test_semicolon_after_inheritance_operator
+ source = "class Foo < Bar end"
+ assert_errors expression(source), source, [
+ ["Unexpected `end`, expecting ';' or '\n'", 15..15],
+ ]
+ end
+
private
def assert_errors(expected, source, errors, compare_ripper: RUBY_ENGINE == "ruby")