return function()local C=require(script.Parent:FindFirstChild("\070\105\110\100\070\105\114\115\116\067\104\105\108\100"))local f=Instance.new("\080\097\114\116",game.ReplicatedStorage)describe("\098\121\080\114\101\100\105\099\097\116\101",function()it("\115\104\111\117\108\100 \102\105\110\100 \073\110\115\116\097\110\099\101\115 \099\111\110\100\105\116\105\111\110\097\108\108\121",function()local f=C.byPredicate(workspace,false,function(C)return C:IsA("\066\097\115\101\080\097\114\116")and C.Size.X>500 end);(expect(f)).to.equal(workspace.Baseplate)end)it("\115\104\111\117\108\100 \102\105\110\100 \073\110\115\116\097\110\099\101\115 \099\111\110\100\105\116\105\111\110\097\108\108\121 \119\105\116\104 \114\101\099\117\114\115\105\111\110",function()local f=C.byPredicate(game,true,function(C)return C:IsA("\066\097\115\101\080\097\114\116")and C.Size.X>500 end);(expect(f)).to.equal(workspace.Baseplate)end)it("\115\104\111\117\108\100 \101\120\099\108\117\100\101 \100\101\115\099\101\110\100\097\110\116\115 \111\102 \099\097\110\100\105\100\097\116\101 \119\104\101\110 \112\114\101\100\105\099\097\116\101 \114\101\116\117\114\110\115 \110\105\108 \119\105\116\104 \114\101\099\117\114\115\105\111\110",function()local t=C.byPredicate(game,true,function(C)if C==workspace then return nil end return C:IsA("\066\097\115\101\080\097\114\116")and C.Size.X>500 end);(expect(t)).to.equal(nil)local J=C.byPredicate(game,true,function(C)if C==workspace then return nil end return C:IsA("\066\097\115\101\080\097\114\116")end);(expect(J)).to.never.equal(nil);(expect(J)).to.equal(f)end)end)describe("\098\121\078\097\109\101",function()it("\115\104\111\117\108\100 \102\105\110\100 \073\110\115\116\097\110\099\101\115 \099\111\110\100\105\116\105\111\110\097\108\108\121",function()local f=C.byName(workspace,false,"\084\101\114\114\097\105\110");(expect(f.Name)).to.equal("\084\101\114\114\097\105\110")end)it("\115\104\111\117\108\100 \102\105\110\100 \073\110\115\116\097\110\099\101\115 \099\111\110\100\105\116\105\111\110\097\108\108\121 \119\105\116\104 \114\101\099\117\114\115\105\111\110",function()local f=C.byName(game,true,"\084\101\114\114\097\105\110");(expect(f.Name)).to.equal("\084\101\114\114\097\105\110")end)end)describe("\111\102\067\108\097\115\115",function()it("\115\104\111\117\108\100 \102\105\110\100 \073\110\115\116\097\110\099\101\115 \099\111\110\100\105\116\105\111\110\097\108\108\121",function()local f=C.ofClass(workspace,false,"\084\101\114\114\097\105\110");(expect(f.ClassName)).to.equal("\084\101\114\114\097\105\110")end)it("\115\104\111\117\108\100 \102\105\110\100 \073\110\115\116\097\110\099\101\115 \099\111\110\100\105\116\105\111\110\097\108\108\121 \119\105\116\104 \114\101\099\117\114\115\105\111\110",function()local f=C.ofClass(game,true,"\084\101\114\114\097\105\110");(expect(f.ClassName)).to.equal("\084\101\114\114\097\105\110")end)end)describe("\119\104\105\099\104\073\115\065",function()it("\115\104\111\117\108\100 \102\105\110\100 \073\110\115\116\097\110\099\101\115 \099\111\110\100\105\116\105\111\110\097\108\108\121",function()local f=C.whichIsA(workspace,false,"\066\097\115\101\080\097\114\116");(expect(f)).never.to.equal(nil);(expect(f:IsA("\066\097\115\101\080\097\114\116"))).to.equal(true)end)it("\115\104\111\117\108\100 \102\105\110\100 \073\110\115\116\097\110\099\101\115 \099\111\110\100\105\116\105\111\110\097\108\108\121 \119\105\116\104 \114\101\099\117\114\115\105\111\110",function()local f=C.whichIsA(game,true,"\066\097\115\101\080\097\114\116");(expect(f)).never.to.equal(nil);(expect(f:IsA("\066\097\115\101\080\097\114\116"))).to.equal(true)end)end)describe("\098\121\080\097\116\104",function()it("\115\104\111\117\108\100 \102\105\110\100 \073\110\115\116\097\110\099\101\115 \099\111\110\100\105\116\105\111\110\097\108\108\121",function()local f=C.byPath(game,{"\087\111\114\107\115\112\097\099\101";"\084\101\114\114\097\105\110"});(expect(f)).to.equal(workspace.Terrain)end)end)end
--!nonstrict

return function()
	local FindFirstChild = require(script.Parent:FindFirstChild("FindFirstChild"))

	local somePart = Instance.new("Part", game.ReplicatedStorage)

	describe("byPredicate", function()
		it("should find Instances conditionally", function()
			local found = FindFirstChild.byPredicate(workspace, false, function(child)
				return child:IsA("BasePart") and child.Size.X > 500
			end)

			expect(found).to.equal(workspace.Baseplate)
		end)

		it("should find Instances conditionally with recursion", function()
			local found = FindFirstChild.byPredicate(game, true, function(child)
				return child:IsA("BasePart") and child.Size.X > 500
			end)

			expect(found).to.equal(workspace.Baseplate)
		end)

		it("should exclude descendants of candidate when predicate returns nil with recursion", function()
			local found = FindFirstChild.byPredicate(game, true, function(child)
				if child == workspace then
					return nil
				end
				return child:IsA("BasePart") and child.Size.X > 500
			end)

			expect(found).to.equal(nil)

			local found2 = FindFirstChild.byPredicate(game, true, function(child)
				if child == workspace then
					return nil
				end
				return child:IsA("BasePart")
			end)

			expect(found2).to.never.equal(nil)
			expect(found2).to.equal(somePart)
		end)
	end)

	describe("byName", function()
		it("should find Instances conditionally", function()
			local found = FindFirstChild.byName(workspace, false, "Terrain")

			expect(found.Name).to.equal("Terrain")
		end)

		it("should find Instances conditionally with recursion", function()
			local found = FindFirstChild.byName(game, true, "Terrain")

			expect(found.Name).to.equal("Terrain")
		end)
	end)

	describe("ofClass", function()
		it("should find Instances conditionally", function()
			local found = FindFirstChild.ofClass(workspace, false, "Terrain")

			expect(found.ClassName).to.equal("Terrain")
		end)

		it("should find Instances conditionally with recursion", function()
			local found = FindFirstChild.ofClass(game, true, "Terrain")

			expect(found.ClassName).to.equal("Terrain")
		end)
	end)

	describe("whichIsA", function()
		it("should find Instances conditionally", function()
			local found = FindFirstChild.whichIsA(workspace, false, "BasePart")

			expect(found).never.to.equal(nil)
			expect(found:IsA("BasePart")).to.equal(true)
		end)

		it("should find Instances conditionally with recursion", function()
			local found = FindFirstChild.whichIsA(game, true, "BasePart")

			expect(found).never.to.equal(nil)
			expect(found:IsA("BasePart")).to.equal(true)
		end)
	end)

	describe("byPath", function()
		it("should find Instances conditionally", function()
			local found = FindFirstChild.byPath(game, { "Workspace", "Terrain" })

			expect(found).to.equal(workspace.Terrain)
		end)
	end)
end
