diff options
| author | Kevin Newton <kddnewton@gmail.com> | 2024-08-15 12:39:19 -0400 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2024-08-15 16:50:00 +0000 |
| commit | 5cb6954baa35928af2f23eec5f4a2cd3b360af75 (patch) | |
| tree | 597b61ce2d5cbf26f772b175a3f122d10c4eeaf2 /test | |
| parent | d2361ba156af1be20469bfd2a2e1dda21d48f375 (diff) | |
[ruby/prism] Fix up lex result constants
https://github.com/ruby/prism/commit/084baca463
Diffstat (limited to 'test')
| -rw-r--r-- | test/prism/api/lex_test.rb | 23 | ||||
| -rw-r--r-- | test/prism/api/parse_test.rb | 8 |
2 files changed, 31 insertions, 0 deletions
diff --git a/test/prism/api/lex_test.rb b/test/prism/api/lex_test.rb new file mode 100644 index 0000000000..0b675b215f --- /dev/null +++ b/test/prism/api/lex_test.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +module Prism + class LexTest < TestCase + def test_lex_result + result = Prism.lex("") + assert_kind_of LexResult, result + + result = Prism.lex_file(__FILE__) + assert_kind_of LexResult, result + end + + def test_parse_lex_result + result = Prism.parse_lex("") + assert_kind_of ParseLexResult, result + + result = Prism.parse_lex_file(__FILE__) + assert_kind_of ParseLexResult, result + end + end +end diff --git a/test/prism/api/parse_test.rb b/test/prism/api/parse_test.rb index 864d38461a..dda0d6959c 100644 --- a/test/prism/api/parse_test.rb +++ b/test/prism/api/parse_test.rb @@ -4,6 +4,14 @@ require_relative "../test_helper" module Prism class ParseTest < TestCase + def test_parse_result + result = Prism.parse("") + assert_kind_of ParseResult, result + + result = Prism.parse_file(__FILE__) + assert_kind_of ParseResult, result + end + def test_parse_empty_string result = Prism.parse("") assert_equal [], result.value.statements.body |
