Sha256: 60f47b0d33c907110ee88e65e993c3cf3d617e3b97af9e8d9747ad9a7389bfdf

Contents?: true

Size: 744 Bytes

Versions: 8

Compression:

Stored size: 744 Bytes

Contents

require 'minitest_helper'

class TestLexer < MiniTest::Unit::TestCase
  def test_general
    lexeds = Hilbert::Lexer::WorldLexer.execute('(A -> B) <-> (C|D)&(E&~R)')
    assert_equal(22, lexeds.count)
    Hilbert::Parser::WorldParser.execute(lexeds)
    assert_equal(
      "($world.atom(:A)  >=  $world.atom(:B))  <=>  ($world.atom(:C) + $world.atom(:D)) * ($world.atom(:E) *  ~$world.atom(:R))",
      Hilbert::Parser::WorldParser.parsed_srt
    )


    lexeds = Hilbert::Lexer::WorldLexer.execute('(A & (A -> B)) -> B')
    Hilbert::Parser::WorldParser.execute(lexeds)
    assert_equal(
       "($world.atom(:A)  *  ($world.atom(:A)  >=  $world.atom(:B)))  >=  $world.atom(:B)",
      Hilbert::Parser::WorldParser.parsed_srt
    )
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
hilbert-0.0.2700420 test/world/test_lexer.rb
hilbert-0.0.2700410 test/world/test_lexer.rb
hilbert-0.0.2700400 test/world/test_lexer.rb
hilbert-0.0.2700320 test/world/test_lexer.rb
hilbert-0.0.2700300 test/world/test_lexer.rb
hilbert-0.0.2700210 test/world/test_lexer.rb
hilbert-0.0.2700110 test/world/test_lexer.rb
hilbert-0.0.2700100 test/world/test_lexer.rb