return function()local A=require(script.Parent)it("\115\104\111\117\108\100 \115\117\112\112\111\114\116 \098\097\115\105\099 \116\121\112\101\115",function()assert(A.any(""))assert(A.boolean(true))assert(A.none(nil))assert(A.number(1))assert(A.string("\102\111\111"))assert(A.table({}))assert(not A.any(nil))assert(not A.boolean("\116\114\117\101"))assert(not A.none(1))assert(not A.number(true))assert(not A.string(true))assert(not A.table(82))end)it("\115\104\111\117\108\100 \115\117\112\112\111\114\116 \115\112\101\099\105\097\108 \110\117\109\098\101\114 \116\121\112\101\115",function()local g=A.numberMax(10)local r=A.numberMin(2)local i=A.numberMaxExclusive(10)local Z=A.numberMinExclusive(2)local M=A.numberConstrained(8,11)local q=A.numberConstrainedExclusive(8,11)assert(g(5))assert(g(10))assert(not g(11))assert(not g())assert(r(5))assert(r(2))assert(not r(1))assert(not r())assert(i(5))assert(i(9))assert(not i(10))assert(not i())assert(Z(5))assert(Z(3))assert(not Z(2))assert(not Z())assert(not M(7))assert(M(8))assert(M(9))assert(M(11))assert(not M(12))assert(not M())assert(not q(7))assert(not q(8))assert(q(9))assert(not q(11))assert(not q(12))assert(not q())end)it("\115\104\111\117\108\100 \115\117\112\112\111\114\116 \111\112\116\105\111\110\097\108 \116\121\112\101\115",function()local g=A.optional(A.string)assert(g(""))assert(g())assert(not g(1))end)it("\115\104\111\117\108\100 \115\117\112\112\111\114\116 \116\117\112\108\101 \116\121\112\101\115",function()local g=A.tuple(A.number,A.string,A.optional(A.number))assert(g(1,"\050",3))assert(g(1,"\050"))assert(not g(1,"\050","\051"))end)it("\115\104\111\117\108\100 \115\117\112\112\111\114\116 \117\110\105\111\110 \116\121\112\101\115",function()local g=A.union(A.number,A.string)assert(g(1))assert(g("\049"))assert(not g(nil))end)it("\115\104\111\117\108\100 \115\117\112\112\111\114\116 \108\105\116\101\114\097\108 \116\121\112\101\115",function()local g=A.literal("\102\111\111")local r=A.union(A.literal("\102\111\111"),A.literal("\098\097\114"),A.literal("\111\111\102"))assert(g("\102\111\111"))assert(r("\102\111\111"))assert(r("\098\097\114"))assert(r("\111\111\102"))assert(not g("\070\079\079"))assert(not r("\070\079\079"))assert(not r("\066\065\082"))assert(not r("\079\079\070"))end)it("\115\104\111\117\108\100 \115\117\112\112\111\114\116 \109\117\108\116\105\112\108\101 \108\105\116\101\114\097\108 \116\121\112\101\115",function()local g=A.literal("\102\111\111")local r=A.literal("\102\111\111","\098\097\114","\111\111\102")assert(g("\102\111\111"))assert(r("\102\111\111"))assert(r("\098\097\114"))assert(r("\111\111\102"))assert(not g("\070\079\079"))assert(not r("\070\079\079"))assert(not r("\066\065\082"))assert(not r("\079\079\070"))end)it("\115\104\111\117\108\100 \115\117\112\112\111\114\116 \105\110\116\101\114\115\101\099\116\105\111\110 \116\121\112\101\115",function()local g=A.intersection(A.integer,A.numberMax(5000))assert(g(1))assert(not g(5001))assert(not g(1.1))assert(not g("\049"))end)describe("\097\114\114\097\121",function()it("\115\104\111\117\108\100 \115\117\112\112\111\114\116 \097\114\114\097\121 \116\121\112\101\115",function()local g=A.array(A.string)local r=A.array(A.any)local i=A.values(A.string)assert(not r("\102\111\111"))assert(r({1;"\050";3}))assert(not g({1;"\050",3}))assert(not g())assert(not i())assert(r({"\049","\050","\051"},A.string))assert(not r({foo="\098\097\114"}))assert(not r({[1]="\110\111\110";[5]="\115\101\113\117\101\110\116\105\097\108"}))end)it("\115\104\111\117\108\100 \110\111\116 \098\101 \102\111\111\108\101\100 \098\121 \115\112\097\114\115\101 \097\114\114\097\121\115",function()local g=A.array(A.any)assert(not g({[1]=1;[2]=2;[4]=4}))end)end)it("\115\104\111\117\108\100 \115\117\112\112\111\114\116 \109\097\112 \116\121\112\101\115",function()local g=A.map(A.string,A.number)assert(g({}))assert(g({a=1}))assert(not g({[1]="\097"}))assert(not g({a="\097"}))assert(not g())end)it("\115\104\111\117\108\100 \115\117\112\112\111\114\116 \115\101\116 \116\121\112\101\115",function()local g=A.set(A.string)assert(g({}))assert(g({a=true}))assert(not g({[1]="\097"}))assert(not g({a="\097"}))assert(not g({a=false}))assert(not g())end)it("\115\104\111\117\108\100 \115\117\112\112\111\114\116 \105\110\116\101\114\102\097\099\101 \116\121\112\101\115",function()local g=A.interface({x=A.number;y=A.number;z=A.number})assert(g({w=0,x=1,y=2;z=3}))assert(not g({w=0,x=1;y=2}))end)it("\115\104\111\117\108\100 \115\117\112\112\111\114\116 \115\116\114\105\099\116 \105\110\116\101\114\102\097\099\101 \116\121\112\101\115",function()local g=A.strictInterface({x=A.number,y=A.number,z=A.number})assert(not g(0))assert(not g({w=0;x=1,y=2;z=3}))assert(not g({w=0;x=1;y=2}))assert(g({x=1,y=2;z=3}))end)it("\115\104\111\117\108\100 \115\117\112\112\111\114\116 \100\101\101\112 \105\110\116\101\114\102\097\099\101 \116\121\112\101\115",function()local g=A.interface({name=A.string,inventory=A.interface({size=A.number})})assert(g({name="\084\101\115\116\080\108\097\121\101\114",inventory={size=1}}))assert(not g({inventory={size=1}}))assert(not g({name="\084\101\115\116\080\108\097\121\101\114",inventory={}}))assert(not g({name="\084\101\115\116\080\108\097\121\101\114"}))end)it("\115\104\111\117\108\100 \115\117\112\112\111\114\116 \100\101\101\112 \111\112\116\105\111\110\097\108 \105\110\116\101\114\102\097\099\101 \116\121\112\101\115",function()local g=A.interface({name=A.string;inventory=A.optional(A.interface({size=A.number}))})assert(g({name="\084\101\115\116\080\108\097\121\101\114"}))assert(not g({name="\084\101\115\116\080\108\097\121\101\114",inventory={}}))assert(g({name="\084\101\115\116\080\108\097\121\101\114",inventory={size=1}}))end)it("\115\104\111\117\108\100 \115\117\112\112\111\114\116 \082\111\098\108\111\120 \073\110\115\116\097\110\099\101 \116\121\112\101\115",function()local g=A.instanceOf("\083\116\114\105\110\103\086\097\108\117\101")local r=Instance.new("\083\116\114\105\110\103\086\097\108\117\101")local i=Instance.new("\066\111\111\108\086\097\108\117\101")assert(g(r))assert(not g(i))assert(not g())end)it("\115\104\111\117\108\100 \115\117\112\112\111\114\116 \082\111\098\108\111\120 \073\110\115\116\097\110\099\101 \116\121\112\101\115 \105\110\104\101\114\105\116\097\110\099\101",function()local g=A.instanceIsA("\071\117\105\079\098\106\101\099\116")local r=Instance.new("\070\114\097\109\101")local i=Instance.new("\084\101\120\116\076\097\098\101\108")local Z=Instance.new("\083\116\114\105\110\103\086\097\108\117\101")assert(g(r))assert(g(i))assert(not g(Z))assert(not g())end)it("\115\104\111\117\108\100 \115\117\112\112\111\114\116 \082\111\098\108\111\120 \069\110\117\109 \116\121\112\101\115",function()local g=A.enum(Enum.SortOrder)assert(A.Enum(Enum.SortOrder))assert(not A.Enum("\069\110\117\109\046\083\111\114\116\079\114\100\101\114"))assert(A.EnumItem(Enum.SortOrder.Name))assert(not A.EnumItem("\069\110\117\109\046\083\111\114\116\079\114\100\101\114\046\078\097\109\101"))assert(g(Enum.SortOrder.Name))assert(g(Enum.SortOrder.Custom))assert(not g(Enum.EasingStyle.Linear))assert(not g())end)it("\115\104\111\117\108\100 \115\117\112\112\111\114\116 \082\111\098\108\111\120 \082\066\088\083\099\114\105\112\116\083\105\103\110\097\108",function()assert(A.RBXScriptSignal(game.ChildAdded))assert(not A.RBXScriptSignal(nil))assert(not A.RBXScriptSignal(Vector3.new()))end)it("\115\104\111\117\108\100 \115\117\112\112\111\114\116 \119\114\097\112\112\105\110\103 \102\117\110\099\116\105\111\110 \116\121\112\101\115",function()local g=A.tuple(A.string,A.number,A.optional(A.string))local r=A.wrap(function(A,g,r)local i=string.format("\037\115 \037\100",A,g)if r then i=i..(" "..r)end return i end,g)assert(not pcall(r))assert(not pcall(r,"\097"))assert(not pcall(r,2))assert(pcall(r,"\097",1))assert(pcall(r,"\097",1,"\098"))end)it("\115\104\111\117\108\100 \115\117\112\112\111\114\116 \115\116\114\105\099\116 \116\121\112\101\115",function()local g=A.strict(A.tuple(A.string,A.number))assert(not pcall(function()g("\097","\098")end))assert(pcall(function()g("\097",1)end))end)it("\115\104\111\117\108\100 \115\117\112\112\111\114\116 \099\111\109\109\111\110 \079\079\080 \116\121\112\101\115",function()local g={}g.__index=g function g.new()local A=setmetatable({},g)return A end local function r(g)return function(r)local i,Z=A.table(r)if not i then return false,Z or""end local M=getmetatable(r)if not M or M.__index~=g then return false,"\098\097\100 \109\101\109\098\101\114 \111\102 \099\108\097\115\115"end return true end end local i=r(g)local Z=g.new()assert(i(Z))assert(not i({}))assert(not i())end)it("\115\104\111\117\108\100 \110\111\116 \116\114\101\097\116 \078\097\078 \097\115 \110\117\109\098\101\114\115",function()assert(A.number(1))assert(not A.number(0/0))assert(not A.number("\049"))end)it("\115\104\111\117\108\100 \110\111\116 \116\114\101\097\116 \110\117\109\098\101\114\115 \097\115 \078\097\078",function()assert(not A.nan(1))assert(A.nan(0/0))assert(not A.nan("\049"))end)it("\115\104\111\117\108\100 \097\108\108\111\119 \117\110\105\111\110 \111\102 \110\117\109\098\101\114 \097\110\100 \078\097\078",function()local g=A.union(A.number,A.nan)assert(g(1))assert(g(0/0))assert(not g("\049"))end)it("\115\104\111\117\108\100 \115\117\112\112\111\114\116 \110\111\110-\115\116\114\105\110\103 \107\101\121\115 \102\111\114 \105\110\116\101\114\102\097\099\101\115",function()local g={}local r=A.interface({[g]=A.number})assert(r({[g]=1}))assert(not r({[g]="\049"}))end)it("\115\104\111\117\108\100 \115\117\112\112\111\114\116 \102\097\105\108\105\110\103 \111\110 \110\111\110-\115\116\114\105\110\103 \107\101\121\115 \102\111\114 \115\116\114\105\099\116 \105\110\116\101\114\102\097\099\101\115",function()local g=A.strictInterface({a=A.number})assert(not g({a=1;[{}]=2}))end)it("\115\104\111\117\108\100 \115\117\112\112\111\114\116 \099\104\105\108\100\114\101\110",function()local g=A.interface({buttonInFrame=A.intersection(A.instanceOf("\070\114\097\109\101"),A.children({MyButton=A.instanceOf("\073\109\097\103\101\066\117\116\116\111\110")}))})assert(not(A.children({}))(5))assert(not g({buttonInFrame=Instance.new("\070\114\097\109\101")}))do local A=Instance.new("\070\114\097\109\101")local r=Instance.new("\073\109\097\103\101\066\117\116\116\111\110",A)r.Name="\077\121\066\117\116\116\111\110"assert(g({buttonInFrame=A}))end do local A=Instance.new("\070\114\097\109\101")local r=Instance.new("\073\109\097\103\101\066\117\116\116\111\110",A)r.Name="\078\111\116\077\121\066\117\116\116\111\110"assert(not g({buttonInFrame=A}))end do local A=Instance.new("\070\114\097\109\101")local r=Instance.new("\084\101\120\116\066\117\116\116\111\110",A)r.Name="\077\121\066\117\116\116\111\110"assert(not g({buttonInFrame=A}))end do local A=Instance.new("\070\114\097\109\101")local r=Instance.new("\073\109\097\103\101\066\117\116\116\111\110",A)r.Name="\077\121\066\117\116\116\111\110"local i=Instance.new("\073\109\097\103\101\066\117\116\116\111\110",A)i.Name="\077\121\066\117\116\116\111\110"assert(not g({buttonInFrame=A}))end end)it("\115\104\111\117\108\100 \115\117\112\112\111\114\116 \116\046\105\110\115\116\097\110\099\101\079\102 \115\104\111\114\116\104\097\110\100",function()local g=A.interface({buttonInFrame=A.instanceOf("\070\114\097\109\101",{MyButton=A.instanceOf("\073\109\097\103\101\066\117\116\116\111\110")})})assert(not(A.children({}))(5))assert(not g({buttonInFrame=Instance.new("\070\114\097\109\101")}))do local A=Instance.new("\070\114\097\109\101")local r=Instance.new("\073\109\097\103\101\066\117\116\116\111\110",A)r.Name="\077\121\066\117\116\116\111\110"assert(g({buttonInFrame=A}))end do local A=Instance.new("\070\114\097\109\101")local r=Instance.new("\073\109\097\103\101\066\117\116\116\111\110",A)r.Name="\078\111\116\077\121\066\117\116\116\111\110"assert(not g({buttonInFrame=A}))end do local A=Instance.new("\070\114\097\109\101")local r=Instance.new("\084\101\120\116\066\117\116\116\111\110",A)r.Name="\077\121\066\117\116\116\111\110"assert(not g({buttonInFrame=A}))end do local A=Instance.new("\070\114\097\109\101")local r=Instance.new("\073\109\097\103\101\066\117\116\116\111\110",A)r.Name="\077\121\066\117\116\116\111\110"local i=Instance.new("\073\109\097\103\101\066\117\116\116\111\110",A)i.Name="\077\121\066\117\116\116\111\110"assert(not g({buttonInFrame=A}))end end)it("\115\104\111\117\108\100 \115\117\112\112\111\114\116 \116\046\105\110\115\116\097\110\099\101\073\115\065 \115\104\111\114\116\104\097\110\100",function()local g=A.interface({buttonInFrame=A.instanceIsA("\070\114\097\109\101",{MyButton=A.instanceIsA("\073\109\097\103\101\066\117\116\116\111\110")})})assert(not(A.children({}))(5))assert(not g({buttonInFrame=Instance.new("\070\114\097\109\101")}))do local A=Instance.new("\070\114\097\109\101")local r=Instance.new("\073\109\097\103\101\066\117\116\116\111\110",A)r.Name="\077\121\066\117\116\116\111\110"assert(g({buttonInFrame=A}))end do local A=Instance.new("\070\114\097\109\101")local r=Instance.new("\073\109\097\103\101\066\117\116\116\111\110",A)r.Name="\078\111\116\077\121\066\117\116\116\111\110"assert(not g({buttonInFrame=A}))end do local A=Instance.new("\070\114\097\109\101")local r=Instance.new("\084\101\120\116\066\117\116\116\111\110",A)r.Name="\077\121\066\117\116\116\111\110"assert(not g({buttonInFrame=A}))end do local A=Instance.new("\070\114\097\109\101")local r=Instance.new("\073\109\097\103\101\066\117\116\116\111\110",A)r.Name="\077\121\066\117\116\116\111\110"local i=Instance.new("\073\109\097\103\101\066\117\116\116\111\110",A)i.Name="\077\121\066\117\116\116\111\110"assert(not g({buttonInFrame=A}))end end)it("\115\104\111\117\108\100 \115\117\112\112\111\114\116 \116\046\109\097\116\099\104",function()local g=A.match("\037\100\043")assert(g("\049\050\051"))assert(not g("\097\098\099"))assert(not g())end)it("\115\104\111\117\108\100 \115\117\112\112\111\114\116 \116\046\107\101\121\079\102",function()local g={OptionA={},OptionB={}}local r=A.keyOf(g)assert(r("\079\112\116\105\111\110\065"))assert(not r("\079\112\116\105\111\110\067"))end)it("\115\104\111\117\108\100 \115\117\112\112\111\114\116 \116\046\118\097\108\117\101\079\102",function()local g={OptionA={},OptionB={}}local r=A.valueOf(g)assert(r(g.OptionA))assert(not r(1010))end)it("\115\104\111\117\108\100 \115\117\112\112\111\114\116 \116\046\115\116\114\105\099\116\065\114\114\097\121",function()local g=A.strictArray(A.number,A.number)assert(g({1,2}))assert(not g({1;2,3}))assert(not g({10}))assert(not g({"\072\101\108\108\111",10}))assert(not g({Foo="\066\097\114"}))local r=A.strictArray(A.number,A.number,A.optional(A.string))assert(r({10;20}))assert(r({10,20;"\072\101\108\108\111"}))assert(not r({10;20;30}))end)end
return function()
	local t = require(script.Parent)

	it("should support basic types", function()
		assert(t.any(""))
		assert(t.boolean(true))
		assert(t.none(nil))
		assert(t.number(1))
		assert(t.string("foo"))
		assert(t.table({}))

		assert(not (t.any(nil)))
		assert(not (t.boolean("true")))
		assert(not (t.none(1)))
		assert(not (t.number(true)))
		assert(not (t.string(true)))
		assert(not (t.table(82)))
	end)

	it("should support special number types", function()
		local maxTen = t.numberMax(10)
		local minTwo = t.numberMin(2)
		local maxTenEx = t.numberMaxExclusive(10)
		local minTwoEx = t.numberMinExclusive(2)
		local constrainedEightToEleven = t.numberConstrained(8, 11)
		local constrainedEightToElevenEx = t.numberConstrainedExclusive(8, 11)

		assert(maxTen(5))
		assert(maxTen(10))
		assert(not (maxTen(11)))
		assert(not (maxTen()))

		assert(minTwo(5))
		assert(minTwo(2))
		assert(not (minTwo(1)))
		assert(not (minTwo()))

		assert(maxTenEx(5))
		assert(maxTenEx(9))
		assert(not (maxTenEx(10)))
		assert(not (maxTenEx()))

		assert(minTwoEx(5))
		assert(minTwoEx(3))
		assert(not (minTwoEx(2)))
		assert(not (minTwoEx()))

		assert(not (constrainedEightToEleven(7)))
		assert(constrainedEightToEleven(8))
		assert(constrainedEightToEleven(9))
		assert(constrainedEightToEleven(11))
		assert(not (constrainedEightToEleven(12)))
		assert(not (constrainedEightToEleven()))

		assert(not (constrainedEightToElevenEx(7)))
		assert(not (constrainedEightToElevenEx(8)))
		assert(constrainedEightToElevenEx(9))
		assert(not (constrainedEightToElevenEx(11)))
		assert(not (constrainedEightToElevenEx(12)))
		assert(not (constrainedEightToElevenEx()))
	end)

	it("should support optional types", function()
		local check = t.optional(t.string)
		assert(check(""))
		assert(check())
		assert(not (check(1)))
	end)

	it("should support tuple types", function()
		local myTupleCheck = t.tuple(t.number, t.string, t.optional(t.number))
		assert(myTupleCheck(1, "2", 3))
		assert(myTupleCheck(1, "2"))
		assert(not (myTupleCheck(1, "2", "3")))
	end)

	it("should support union types", function()
		local numberOrString = t.union(t.number, t.string)
		assert(numberOrString(1))
		assert(numberOrString("1"))
		assert(not (numberOrString(nil)))
	end)

	it("should support literal types", function()
		local checkSingle = t.literal("foo")
		local checkUnion = t.union(t.literal("foo"), t.literal("bar"), t.literal("oof"))

		assert(checkSingle("foo"))
		assert(checkUnion("foo"))
		assert(checkUnion("bar"))
		assert(checkUnion("oof"))

		assert(not (checkSingle("FOO")))
		assert(not (checkUnion("FOO")))
		assert(not (checkUnion("BAR")))
		assert(not (checkUnion("OOF")))
	end)

	it("should support multiple literal types", function()
		local checkSingle = t.literal("foo")
		local checkUnion = t.literal("foo", "bar", "oof")

		assert(checkSingle("foo"))
		assert(checkUnion("foo"))
		assert(checkUnion("bar"))
		assert(checkUnion("oof"))

		assert(not (checkSingle("FOO")))
		assert(not (checkUnion("FOO")))
		assert(not (checkUnion("BAR")))
		assert(not (checkUnion("OOF")))
	end)

	it("should support intersection types", function()
		local integerMax5000 = t.intersection(t.integer, t.numberMax(5000))
		assert(integerMax5000(1))
		assert(not (integerMax5000(5001)))
		assert(not (integerMax5000(1.1)))
		assert(not (integerMax5000("1")))
	end)

	describe("array", function()
		it("should support array types", function()
			local stringArray = t.array(t.string)
			local anyArray = t.array(t.any)
			local stringValues = t.values(t.string)
			assert(not (anyArray("foo")))
			assert(anyArray({1, "2", 3}))
			assert(not (stringArray({1, "2", 3})))
			assert(not (stringArray()))
			assert(not (stringValues()))
			assert(anyArray({"1", "2", "3"}, t.string))
			assert(not (anyArray({
				foo = "bar"
			})))
			assert(not (anyArray({
				[1] = "non",
				[5] = "sequential"
			})))
		end)

		it("should not be fooled by sparse arrays", function()
			local anyArray = t.array(t.any)

			assert(not (anyArray({
				[1] = 1,
				[2] = 2,
				[4] = 4,
			})))
		end)
	end)

	it("should support map types", function()
		local stringNumberMap = t.map(t.string, t.number)
		assert(stringNumberMap({}))
		assert(stringNumberMap({a = 1}))
		assert(not (stringNumberMap({[1] = "a"})))
		assert(not (stringNumberMap({a = "a"})))
		assert(not (stringNumberMap()))
	end)

	it("should support set types", function()
		local stringSet = t.set(t.string)
		assert(stringSet({}))
		assert(stringSet({a = true}))
		assert(not (stringSet({[1] = "a"})))
		assert(not (stringSet({a = "a"})))
		assert(not (stringSet({a = false})))
		assert(not (stringSet()))
	end)

	it("should support interface types", function()
		local IVector3 = t.interface({
			x = t.number,
			y = t.number,
			z = t.number,
		})

		assert(IVector3({
			w = 0,
			x = 1,
			y = 2,
			z = 3,
		}))

		assert(not (IVector3({
			w = 0,
			x = 1,
			y = 2,
		})))
	end)

	it("should support strict interface types", function()
		local IVector3 = t.strictInterface({
			x = t.number,
			y = t.number,
			z = t.number,
		})

		assert(not (IVector3(0)))

		assert(not (IVector3({
			w = 0,
			x = 1,
			y = 2,
			z = 3,
		})))

		assert(not (IVector3({
			w = 0,
			x = 1,
			y = 2,
		})))

		assert(IVector3({
			x = 1,
			y = 2,
			z = 3,
		}))
	end)

	it("should support deep interface types", function()
		local IPlayer = t.interface({
			name = t.string,
			inventory = t.interface({
				size = t.number
			})
		})

		assert(IPlayer({
			name = "TestPlayer",
			inventory = {
				size = 1
			}
		}))

		assert(not (IPlayer({
			inventory = {
				size = 1
			}
		})))

		assert(not (IPlayer({
			name = "TestPlayer",
			inventory = {
			}
		})))

		assert(not (IPlayer({
			name = "TestPlayer",
		})))
	end)

	it("should support deep optional interface types", function()
		local IPlayer = t.interface({
			name = t.string,
			inventory = t.optional(t.interface({
				size = t.number
			}))
		})

		assert(IPlayer({
			name = "TestPlayer"
		}))

		assert(not (IPlayer({
			name = "TestPlayer",
			inventory = {
			}
		})))

		assert(IPlayer({
			name = "TestPlayer",
			inventory = {
				size = 1
			}
		}))
	end)

	it("should support Roblox Instance types", function()
		local stringValueCheck = t.instanceOf("StringValue")
		local stringValue = Instance.new("StringValue")
		local boolValue = Instance.new("BoolValue")

		assert(stringValueCheck(stringValue))
		assert(not (stringValueCheck(boolValue)))
		assert(not (stringValueCheck()))
	end)

	it("should support Roblox Instance types inheritance", function()
		local guiObjectCheck = t.instanceIsA("GuiObject")
		local frame = Instance.new("Frame")
		local textLabel = Instance.new("TextLabel")
		local stringValue = Instance.new("StringValue")

		assert(guiObjectCheck(frame))
		assert(guiObjectCheck(textLabel))
		assert(not (guiObjectCheck(stringValue)))
		assert(not (guiObjectCheck()))
	end)

	it("should support Roblox Enum types", function()
		local sortOrderEnumCheck = t.enum(Enum.SortOrder)
		assert(t.Enum(Enum.SortOrder))
		assert(not (t.Enum("Enum.SortOrder")))

		assert(t.EnumItem(Enum.SortOrder.Name))
		assert(not (t.EnumItem("Enum.SortOrder.Name")))

		assert(sortOrderEnumCheck(Enum.SortOrder.Name))
		assert(sortOrderEnumCheck(Enum.SortOrder.Custom))
		assert(not (sortOrderEnumCheck(Enum.EasingStyle.Linear)))
		assert(not (sortOrderEnumCheck()))
	end)

	it("should support Roblox RBXScriptSignal", function()
		assert(t.RBXScriptSignal(game.ChildAdded))
		assert(not (t.RBXScriptSignal(nil)))
		assert(not (t.RBXScriptSignal(Vector3.new())))
	end)

	-- TODO: Add this back when Lemur supports it
	-- it("should support Roblox RBXScriptConnection", function()
	-- 	local conn = game.ChildAdded:Connect(function() end)
	-- 	assert(t.RBXScriptConnection(conn))
	-- 	assert(not (t.RBXScriptConnection(nil)))
	-- 	assert(not (t.RBXScriptConnection(Vector3.new())))
	-- end)

	it("should support wrapping function types", function()
		local checkFoo = t.tuple(t.string, t.number, t.optional(t.string))
		local foo = t.wrap(function(a, b, c)
			local result = string.format("%s %d", a, b)
			if c then
				result = result .. " " .. c
			end
			return result
		end, checkFoo)

		assert(not (pcall(foo)))
		assert(not (pcall(foo, "a")))
		assert(not (pcall(foo, 2)))
		assert(pcall(foo, "a", 1))
		assert(pcall(foo, "a", 1, "b"))
	end)

	it("should support strict types", function()
		local myType = t.strict(t.tuple(t.string, t.number))
		assert(not (pcall(function()
			myType("a", "b")
		end)))
		assert(pcall(function()
			myType("a", 1)
		end))
	end)

	it("should support common OOP types", function()
		local MyClass = {}
		MyClass.__index = MyClass

		function MyClass.new()
			local self = setmetatable({}, MyClass)
			return self
		end

		local function instanceOfClass(class)
			return function(value)
				local tableSuccess, tableErrMsg = t.table(value)
				if not tableSuccess then
					return false, tableErrMsg or ""
				end

				local mt = getmetatable(value)
				if not mt or mt.__index ~= class then
					return false, "bad member of class"
				end

				return true
			end
		end

		local instanceOfMyClass = instanceOfClass(MyClass)

		local myObject = MyClass.new()
		assert(instanceOfMyClass(myObject))
		assert(not (instanceOfMyClass({})))
		assert(not (instanceOfMyClass()))
	end)

	it("should not treat NaN as numbers", function()
		assert(t.number(1))
		assert(not (t.number(0/0)))
		assert(not (t.number("1")))
	end)

	it("should not treat numbers as NaN", function()
		assert(not (t.nan(1)))
		assert(t.nan(0/0))
		assert(not (t.nan("1")))
	end)

	it("should allow union of number and NaN", function()
		local numberOrNaN = t.union(t.number, t.nan)
		assert(numberOrNaN(1))
		assert(numberOrNaN(0/0))
		assert(not (numberOrNaN("1")))
	end)

	it("should support non-string keys for interfaces", function()
		local key = {}
		local myInterface = t.interface({ [key] = t.number })
		assert(myInterface({ [key] = 1 }))
		assert(not (myInterface({ [key] = "1" })))
	end)

	it("should support failing on non-string keys for strict interfaces", function()
		local myInterface = t.strictInterface({ a = t.number })
		assert(not (myInterface({ a = 1, [{}] = 2 })))
	end)

	it("should support children", function()
		local myInterface = t.interface({
			buttonInFrame = t.intersection(t.instanceOf("Frame"), t.children({
				MyButton = t.instanceOf("ImageButton")
			}))
		})

		assert(not (t.children({})(5)))
		assert(not (myInterface({ buttonInFrame = Instance.new("Frame") })))

		do
			local frame = Instance.new("Frame")
			local button = Instance.new("ImageButton", frame)
			button.Name = "MyButton"
			assert(myInterface({ buttonInFrame = frame }))
		end

		do
			local frame = Instance.new("Frame")
			local button = Instance.new("ImageButton", frame)
			button.Name = "NotMyButton"
			assert(not (myInterface({ buttonInFrame = frame })))
		end

		do
			local frame = Instance.new("Frame")
			local button = Instance.new("TextButton", frame)
			button.Name = "MyButton"
			assert(not (myInterface({ buttonInFrame = frame })))
		end

		do
			local frame = Instance.new("Frame")
			local button1 = Instance.new("ImageButton", frame)
			button1.Name = "MyButton"
			local button2 = Instance.new("ImageButton", frame)
			button2.Name = "MyButton"
			assert(not (myInterface({ buttonInFrame = frame })))
		end
	end)

	it("should support t.instanceOf shorthand", function()
		local myInterface = t.interface({
			buttonInFrame = t.instanceOf("Frame", {
				MyButton = t.instanceOf("ImageButton")
			})
		})

		assert(not (t.children({})(5)))
		assert(not (myInterface({ buttonInFrame = Instance.new("Frame") })))

		do
			local frame = Instance.new("Frame")
			local button = Instance.new("ImageButton", frame)
			button.Name = "MyButton"
			assert(myInterface({ buttonInFrame = frame }))
		end

		do
			local frame = Instance.new("Frame")
			local button = Instance.new("ImageButton", frame)
			button.Name = "NotMyButton"
			assert(not (myInterface({ buttonInFrame = frame })))
		end

		do
			local frame = Instance.new("Frame")
			local button = Instance.new("TextButton", frame)
			button.Name = "MyButton"
			assert(not (myInterface({ buttonInFrame = frame })))
		end

		do
			local frame = Instance.new("Frame")
			local button1 = Instance.new("ImageButton", frame)
			button1.Name = "MyButton"
			local button2 = Instance.new("ImageButton", frame)
			button2.Name = "MyButton"
			assert(not (myInterface({ buttonInFrame = frame })))
		end
	end)

	it("should support t.instanceIsA shorthand", function()
		local myInterface = t.interface({
			buttonInFrame = t.instanceIsA("Frame", {
				MyButton = t.instanceIsA("ImageButton")
			})
		})

		assert(not (t.children({})(5)))
		assert(not (myInterface({ buttonInFrame = Instance.new("Frame") })))

		do
			local frame = Instance.new("Frame")
			local button = Instance.new("ImageButton", frame)
			button.Name = "MyButton"
			assert(myInterface({ buttonInFrame = frame }))
		end

		do
			local frame = Instance.new("Frame")
			local button = Instance.new("ImageButton", frame)
			button.Name = "NotMyButton"
			assert(not (myInterface({ buttonInFrame = frame })))
		end

		do
			local frame = Instance.new("Frame")
			local button = Instance.new("TextButton", frame)
			button.Name = "MyButton"
			assert(not (myInterface({ buttonInFrame = frame })))
		end

		do
			local frame = Instance.new("Frame")
			local button1 = Instance.new("ImageButton", frame)
			button1.Name = "MyButton"
			local button2 = Instance.new("ImageButton", frame)
			button2.Name = "MyButton"
			assert(not (myInterface({ buttonInFrame = frame })))
		end
	end)

	it("should support t.match", function()
		local check = t.match("%d+")
		assert(check("123"))
		assert(not (check("abc")))
		assert(not (check()))
	end)

	it("should support t.keyOf", function()
		local myNewEnum = {
			OptionA = {},
			OptionB = {},
		}
		local check = t.keyOf(myNewEnum)
		assert(check("OptionA"))
		assert(not (check("OptionC")))
	end)

	it("should support t.valueOf", function()
		local myNewEnum = {
			OptionA = {},
			OptionB = {},
		}
		local check = t.valueOf(myNewEnum)
		assert(check(myNewEnum.OptionA))
		assert(not (check(1010)))
	end)

	it("should support t.strictArray", function()
		local fixedArrayCheck = t.strictArray(t.number, t.number)

		assert(fixedArrayCheck({1, 2}))
		assert(not fixedArrayCheck({1, 2, 3}))
		assert(not fixedArrayCheck({10}))
		assert(not fixedArrayCheck({"Hello", 10}))
		assert(not fixedArrayCheck({ Foo = "Bar" }))

		local fixedArrayCheck2 = t.strictArray(t.number, t.number, t.optional(t.string))

		assert(fixedArrayCheck2({10, 20}))
		assert(fixedArrayCheck2({10, 20, "Hello"}))
		assert(not fixedArrayCheck2({10, 20, 30}))
	end)
end