Skip to content
Snippets Groups Projects
Commit c82ee3ca authored by Lou Knauer's avatar Lou Knauer
Browse files

Merge branch 'master' of gitlab.cs.fau.de:basst/ruby-dhallish

parents a00c3092 49dccfb8
No related branches found
No related tags found
No related merge requests found
......@@ -257,6 +257,8 @@ module Dhallish
"[#{ dhallval.map{ |val| to_json(val) }.join(", ") }]"
when Hash
"{#{ dhallval.map{ |key, val| "\"#{escape_str(key)}\": #{ to_json(val) }" }.join(", ") }}"
when nil
"null"
else
"\"Dhallish-Internal: #{escape_str(dhallval.inspect)}\""
end
......
......@@ -90,19 +90,13 @@ dhallfiles.each { |file|
dhallish = Dhallish::Dhallish.new
val = (dhallish.evaluate `cat #{file}`)[0]
if !val.nil?
result = JSON.parse(Dhallish::to_json val)
assert("Testing Dhall-Compability for `#{file}`") { expected == result }
end
rescue
print_msg(file, false)
else
if val.nil?
print_msg("#{file} - parsing error", false)
else
print_msg(file, true)
end
end
}
path = File.join(File.dirname(__FILE__), "*.dhallish")
......@@ -114,18 +108,12 @@ dhallfiles.each { |file|
expected = JSON.parse(`cat #{expected_file_name}`)
dhallish = Dhallish::Dhallish.new
val = dhallish.evaluate `cat #{file}`
if !val.nil?
result = JSON.parse(val.to_json)
val = (dhallish.evaluate `cat #{file}`)[0]
result = JSON.parse(Dhallish::to_json val)
assert("Testing Dhall-Compability for `#{file}`") { expected == result }
end
rescue
print_msg(file, false)
else
if val.nil?
print_msg("#{file} - parsing error", false)
else
print_msg(file, true)
end
end
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment