Sha256: 1def667aff265c0a3afc627886f495069e008313aa52fc2c08ee293a1e067817

Contents?: true

Size: 585 Bytes

Versions: 2

Compression:

Stored size: 585 Bytes

Contents

require "json"

$LOAD_PATH.unshift("#{File.dirname(__FILE__)}/lib")

require 'cirru/parser'

names = [
  'comma',
  'demo',
  'folding',
  'html',
  'indent',
  'line',
  'parentheses',
  'quote',
  'spaces',
  'unfolding'
]

def test(name)
  code = IO.read "examples/#{name}.cirru"
  ast = Cirru::Parser.pare(code, 'file')
  genereated = JSON.generate ast
  expected = JSON.generate JSON.parse(IO.read("ast/#{name}.json"))
  if genereated == expected
    print "\nok:\t", name
  else
    print "\nfailed:\t", name
    print genereated
  end
end

names.each do |name|
  test name
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cirru-parser-0.0.2 test.rb
cirru-parser-0.0.1 test.rb