Sha256: 06e82d58cc4e8942deac9b1ee71f45f8458fde3ec0fa419ea2b8a52320f946cd

Contents?: true

Size: 921 Bytes

Versions: 1

Compression:

Stored size: 921 Bytes

Contents

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

class DivisionExpressionTest < Test::Unit::TestCase

  include KoiReferenceParser
  
  test "should parse simple division expression with integers" do
    tree = Parser.parse('test = 1 / 1')
    assert_expression(tree, MultitiveExpression, DivisionOperator)
  end
  
  test "should parse simple division expression with floats" do
    tree = Parser.parse('test = 1.0 / 1.0')
    assert_expression(tree, MultitiveExpression, DivisionOperator)
  end
  
  test "should parse simple division expression with strings" do
    tree = Parser.parse('test = "1" / "1"')
    assert_expression(tree, MultitiveExpression, DivisionOperator)
  end
  
  test "should parse simple division expression with identifiers" do
    tree = Parser.parse('test = test1 / test2')
    assert_expression(tree, MultitiveExpression, DivisionOperator)
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

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