~singpolyma/dhall-ruby

7139831dae25a54ec3e3cba1a3c6b4042c2db3ec — Stephen Paul Weber 3 years ago a74eba6
Test typechecker edge cases
2 files changed, 17 insertions(+), 1 deletions(-)

M lib/dhall/builtins.rb
M test/test_typechecker.rb
M lib/dhall/builtins.rb => lib/dhall/builtins.rb +1 -1
@@ 27,7 27,7 @@ module Dhall
			if (unfilled = unfill).class != self.class
				unfilled.as_json
			else
				self.class.name.split(/::/).last.tr("_", "/")
				self.class.name&.split(/::/)&.last&.tr("_", "/").to_s
			end
		end


M test/test_typechecker.rb => test/test_typechecker.rb +16 -0
@@ 90,4 90,20 @@ class TestTypechecker < Minitest::Test
			).annotate(context).type
		)
	end

	def test_unknown_expression
		assert_raises TypeError do
			Dhall::TypeChecker.for(Class.new.new).annotate(
				Dhall::TypeChecker::Context.new
			)
		end
	end

	def test_unknown_builtin
		assert_raises TypeError do
			Dhall::TypeChecker.for(Class.new(Dhall::Builtin).new).annotate(
				Dhall::TypeChecker::Context.new
			)
		end
	end
end