aboutsummaryrefslogtreecommitdiffstats
path: root/test/prism/ripper_compat_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/prism/ripper_compat_test.rb')
-rw-r--r--test/prism/ripper_compat_test.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/prism/ripper_compat_test.rb b/test/prism/ripper_compat_test.rb
new file mode 100644
index 0000000000..9fcdfe63c6
--- /dev/null
+++ b/test/prism/ripper_compat_test.rb
@@ -0,0 +1,21 @@
+# frozen_string_literal: true
+
+require_relative "test_helper"
+
+module YARP
+ class RipperCompatTest < TestCase
+ def test_1_plus_2
+ assert_equivalent("1 + 2")
+ end
+
+ def test_2_minus_3
+ assert_equivalent("2 - 3")
+ end
+
+ private
+
+ def assert_equivalent(source)
+ assert_equal Ripper.sexp_raw(source), RipperCompat.sexp_raw(source)
+ end
+ end
+end