~singpolyma/dhall-ruby

b66600847a8e6d629555b6517b6dd8c27a77a9c0 — Stephen Paul Weber 3 years ago d2b7142
Run all dhall-last tests for cache_key
1 files changed, 4 insertions(+), 6 deletions(-)

M test/test_cache_key.rb
M test/test_cache_key.rb => test/test_cache_key.rb +4 -6
@@ 3,9 3,7 @@
require "minitest/autorun"
require "pathname"

require "dhall/binary"
require "dhall/parser"
require "dhall/normalize"
require "dhall"

class TestCacheKey < Minitest::Test
	DIRPATH = Pathname.new(File.dirname(__FILE__))


@@ 14,11 12,11 @@ class TestCacheKey < Minitest::Test
	Pathname.glob(TESTS + "**/*A.dhall").each do |path|
		test = path.relative_path_from(TESTS).to_s.sub(/A\.dhall$/, "")
		define_method("test_#{test}") do
			skip "requires resolve" if test =~ /prelude\/|remoteSystems/

			assert_equal(
				(TESTS + "#{test}B.hash").read.chomp,
				Dhall::Parser.parse_file(path).value.cache_key
				Dhall::Parser.parse_file(path).value.resolve(
					relative_to: Dhall::Import::Path.from_string(path)
				).then(&:cache_key).sync
			)
		end
	end