Sha256: 16252f715ce2591f1f1423d3596185e7412949ad69be35cba1238dbd7f2d422c

Contents?: true

Size: 589 Bytes

Versions: 3

Compression:

Stored size: 589 Bytes

Contents

require 'minitest_helper'

class TestGeneral < TestInterpreterBase
  def setup
  end

  # TODO: opposite
  def assert_iq_equal(output, input)
    assert_equal(output, Hilbert::Iq.execute(input))
  end

  def test_general
    assert_iq_equal('2', '1 + 1')
    assert_iq_equal('3 / 2', '1 + 1/2')
    assert_iq_equal('1', '1/2 + 1/2')
    assert_iq_equal('2x', '2x')
    assert_iq_equal('2x', 'x + x')
    # assert_iq_equal('xy', 'xy')
    assert_iq_equal('x ^ y', 'x ^ y')
    assert_iq_equal('2sin( x )', 'sin(x) + sin(x)')
    assert_iq_equal('log( x ) ^ 2', 'log(x) * log(x)')
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
hilbert-0.0.2700420 test/interpreter/test_general.rb
hilbert-0.0.2700410 test/interpreter/test_general.rb
hilbert-0.0.2700400 test/interpreter/test_general.rb