Sha256: d360a797a1a28c471053c94626a97556f908de236ffa0d680821340de59a0a9a

Contents?: true

Size: 566 Bytes

Versions: 1

Compression:

Stored size: 566 Bytes

Contents

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

class RubyKeywordLiteralsTest < Test::Unit::TestCase

  def setup
    @parser = Sexpistol.new
  end

  test "should create nested set of arrays from s-expression" do
    ast = @parser.parse_string('(this (is (an (s_expression))))')
    assert_equal [[:this, [:is, [:an, [:s_expression]]]]], ast
  end
  
  test "should raise error on broken s-expression" do
    assert_raises Exception do
      ast = @parser.parse_string('(this (is (an (s_expression) too)')
    end
  end
    
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sexpistol-0.0.1 test/unit/structure_test.rb