~singpolyma/dhall-ruby

ref: 2c2679ccab6f7903d670439e544ea3cbb74be25b dhall-ruby/test/test_binary.rb -rw-r--r-- 495 bytes
2c2679ccStephen Paul Weber Switch to registry pattern for TypeChecker.for 3 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# frozen_string_literal: true

require "minitest/autorun"
require "pathname"

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

class TestBinary < Minitest::Test
	DIRPATH = Pathname.new(File.dirname(__FILE__))
	TESTS = DIRPATH + "normalization/"

	Pathname.glob(TESTS + "**/*.dhallb").each do |path|
		test = path.relative_path_from(TESTS).to_s.sub(/.dhallb$/, "")
		define_method("test_#{test}") do
			assert_equal(
				path.binread,
				Dhall.from_binary(path.binread).to_binary
			)
		end
	end
end