Sha256: 1bce1096a7666a0ae78c7a0f1c2ce00a724c45640ebc56561c1a2b2c899dfe7d

Contents?: true

Size: 497 Bytes

Versions: 3

Compression:

Stored size: 497 Bytes

Contents

require 'helper'

class TestLexer < Test::Unit::TestCase
  
  EXPRESSIONS = File.readlines(File.join(File.dirname(__FILE__), "test_lexer"))
  TOKENS = File.readlines(File.join(File.dirname(__FILE__), "test_lexer_tokens"))
  
  context "The Lexer" do
    
    EXPRESSIONS.each_with_index do |expr, i|
      lexer = PLang::Parser::Lexer.new(EXPRESSIONS[i])
      should "tokenize the expression ##{i}" do
        assert_equal lexer.next_token.type, eval(TOKENS[i])
      end
    end
  
  end
  
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
p-lang-0.3.1 test/test_lexer.rb
p-lang-0.3.0 test/test_lexer.rb
p-lang-0.2.0 test/test_lexer.rb