Sha256: 01d82d39ce1d79ff849318a59e6b834ce18c4ba83b919515e6790fc987ec5f4c

Contents?: true

Size: 579 Bytes

Versions: 6

Compression:

Stored size: 579 Bytes

Contents

require 'minitest_helper'

class TestQlang < MiniTest::Unit::TestCase
  def setup

  end

  def assert_to_ruby(input, output)
    assert_equal(Q.to_ruby.compile(input), output)
  end

  def test_basis
    refute_nil ::Qlang::VERSION
    assert_equal(Qlang, Q)
  end

  def test_demo_code
    assert_to_ruby('d/dx(sin(x))', 'd/dx(sin(x))')
    assert_to_ruby('d/dx(log(x))', 'd/dx(log(x))')
    assert_to_ruby('f(x, y) = x + y', 'f(x, y) <= x + y')
    assert_equal(Matrix[[1, 2, 3], [4, 5, 6]].to_q, '(1 2 3; 4 5 6)')
    assert_equal(Vector[1, 2, 3].to_q, '(1 2 3)')
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
qlang-0.0.27182123 test/test_qlang.rb
qlang-0.0.27182122 test/test_qlang.rb
qlang-0.0.27182121 test/test_qlang.rb
qlang-0.0.27182120 test/test_qlang.rb
qlang-0.0.27182110 test/test_qlang.rb
qlang-0.0.27182100 test/test_qlang.rb