~singpolyma/dhall-ruby

ref: 371817f2ced59c31642e6c6342ac390a7a3c6c66 dhall-ruby/test/test_normalization.rb -rw-r--r-- 526 bytes
371817f2Stephen Paul Weber Start creating comprehensive normalization tests 4 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# frozen_string_literal: true

require "minitest/autorun"
require "pathname"

require "dhall/ast"
require "dhall/binary"
require "dhall/normalize"

DIRPATH = Pathname.new(File.dirname(__FILE__))
TESTS = DIRPATH + "normalization/beta/"

class TestParser < Minitest::Test
	Pathname.glob(TESTS + "*A.dhallb").each do |path|
		test = path.basename("A.dhallb").to_s
		define_method("test_#{test}") do
			assert_equal(
				Dhall.from_binary(TESTS + "#{test}B.dhallb"),
				Dhall.from_binary(path.read).normalize
			)
		end
	end
end