Sha256: c23c66a83c67b66ca1adb6f1d535d95b3d401e00adf585933a982076c13b871f

Contents?: true

Size: 919 Bytes

Versions: 1

Compression:

Stored size: 919 Bytes

Contents

require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'test_helper.rb'))

class AdditionExpressionTest < Test::Unit::TestCase

  include KoiReferenceParser
  
  test "should parse simple addition expression with integers" do
    tree = Parser.parse('test = 1 + 1')
    assert_expression(tree, AdditiveExpression, AdditionOperator)
  end
  
  test "should parse simple addition expression with floats" do
    tree = Parser.parse('test = 1.0 + 1.0')
    assert_expression(tree, AdditiveExpression, AdditionOperator)
  end
  
  test "should parse simple addition expression with strings" do
    tree = Parser.parse('test = "1" + "1"')
    assert_expression(tree, AdditiveExpression, AdditionOperator)
  end
  
  test "should parse simple addition expression with identifiers" do
    tree = Parser.parse('test = test1 + test2')
    assert_expression(tree, AdditiveExpression, AdditionOperator)
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
koi-reference-parser-0.0.3 test/unit/expressions/addition_expression_test.rb