Skip to content

Instantly share code, notes, and snippets.

@vzvu3k6k
Created April 6, 2014 07:54
Show Gist options
  • Save vzvu3k6k/10002755 to your computer and use it in GitHub Desktop.
Save vzvu3k6k/10002755 to your computer and use it in GitHub Desktop.
# This is a simple test for https://github.com/zenspider/enhanced-ruby-mode/pull/47
#
# 0. Install rbenv
# 1. Save this as "test.rb"
# 2. Install rbenv-each (https://github.com/chriseppstein/rbenv-each)
# 3. Run `rbenv each ruby test.rb`
require 'ripper'
result = Ripper.lex <<HERE
foo
.bar
HERE
expected = [[[1, 0], :on_ident, "foo"],
[[1, 3], :on_period, "\n"],
[[2, 0], :on_ident, " .bar"],
[[2, 6], :on_nl, "\n"]]
puts "#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}: #{result == expected}"
@vzvu3k6k
Copy link
Author

vzvu3k6k commented Apr 6, 2014

1.9.3-p448: true
2.0.0-p353: true
2.1.0-p0: true
2.1.1-p76: true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment