return function()local z=script.Parent local p=z.Parent local K=(require(p)).isMatch describe("\087\105\108\100\109\097\116 \040\103\105\116\041 \116\101\115\116\115",function()it("\066\097\115\105\099 \119\105\108\100\109\097\116 \102\101\097\116\117\114\101\115",function()assert(not K("\102\111\111","\042\102"))assert(not K("\102\111\111","\063\063"))assert(not K("\102\111\111","\098\097\114"))assert(not K("\102\111\111\098\097\114","\102\111\111\092\042\098\097\114"))assert(K("\063\097\063\098","\092\063\063\092\063\098"))assert(K("\097\097\097\097\097\097\097\098\097\098\097\098\097\098","\042\097\098"))assert(K("\102\111\111","\042"))assert(K("\102\111\111","\042\102\111\111\042"))assert(K("\102\111\111","\063\063\063"))assert(K("\102\111\111","\102\042"))assert(K("\102\111\111","\102\111\111"))assert(K("\102\111\111\098\097\114","\042\111\098\042\097\042\114\042"))end)it("\115\104\111\117\108\100 \115\117\112\112\111\114\116 \114\101\099\117\114\115\105\111\110",function()assert(not K("-\097\100\111\098\101-\099\111\117\114\105\101\114-\098\111\108\100-\111-\110\111\114\109\097\108--\049\050-\049\050\048-\055\053-\055\053-\047-\055\048-\105\115\111\056\056\053\057-\049","-\042-\042-\042-\042-\042-\042-\049\050-\042-\042-\042-\109-\042-\042-\042"))assert(not K("-\097\100\111\098\101-\099\111\117\114\105\101\114-\098\111\108\100-\111-\110\111\114\109\097\108--\049\050-\049\050\048-\055\053-\055\053-\088-\055\048-\105\115\111\056\056\053\057-\049","-\042-\042-\042-\042-\042-\042-\049\050-\042-\042-\042-\109-\042-\042-\042"))assert(not K("\097\098\047\099\088\100\047\101\102\088\103\047\104\105","\042\088\042\105"))assert(not K("\097\098\047\099\088\100\047\101\102\088\103\047\104\105","\042\088\103\042\105"))assert(not K("\097\098\099\100\047\097\098\099\100\101\102\103\047\097\098\099\100\101\102\103\104\105\106\107\047\097\098\099\100\101\102\103\104\105\106\107\108\109\110\111\112\046\116\120\116\122","\042\042\047\042\097\042\098\042\103\042\110\042\116"))assert(not K("\102\111\111","\042\047\042\047\042"))assert(not K("\102\111\111","\102\111"))assert(not K("\102\111\111\047\098\097\114","\042\047\042\047\042"))assert(not K("\102\111\111\047\098\097\114","\102\111\111\063\098\097\114"))assert(not K("\102\111\111\047\098\098\047\097\097\047\114\114","\042\047\042\047\042"))assert(not K("\102\111\111\047\098\098\097\047\097\114\114","\102\111\111\042"))assert(not K("\102\111\111\047\098\098\097\047\097\114\114","\102\111\111\042\042"))assert(not K("\102\111\111\047\098\098\097\047\097\114\114","\102\111\111\047\042"))assert(not K("\102\111\111\047\098\098\097\047\097\114\114","\102\111\111\047\042\042\122"))assert(not K("\102\111\111\047\098\098\097\047\097\114\114","\102\111\111\047\042\097\114\114"))assert(not K("\102\111\111\047\098\098\097\047\097\114\114","\102\111\111\047\042\122"))assert(not K("\088\088\088\047\097\100\111\098\101\047\099\111\117\114\105\101\114\047\098\111\108\100\047\111\047\110\111\114\109\097\108\047\047\049\050\047\049\050\048\047\055\053\047\055\053\047\088\047\055\048\047\105\115\111\056\056\053\057\047\049","\088\088\088\047\042\047\042\047\042\047\042\047\042\047\042\047\049\050\047\042\047\042\047\042\047\109\047\042\047\042\047\042"))assert(K("-\097\100\111\098\101-\099\111\117\114\105\101\114-\098\111\108\100-\111-\110\111\114\109\097\108--\049\050-\049\050\048-\055\053-\055\053-\109-\055\048-\105\115\111\056\056\053\057-\049","-\042-\042-\042-\042-\042-\042-\049\050-\042-\042-\042-\109-\042-\042-\042"))assert(K("\097\098\047\099\088\100\047\101\102\088\103\047\104\105","\042\042\047\042\088\042\047\042\042\047\042\105"))assert(K("\097\098\047\099\088\100\047\101\102\088\103\047\104\105","\042\047\042\088\042\047\042\047\042\105"))assert(K("\097\098\099\100\047\097\098\099\100\101\102\103\047\097\098\099\100\101\102\103\104\105\106\107\047\097\098\099\100\101\102\103\104\105\106\107\108\109\110\111\112\046\116\120\116","\042\042\047\042\097\042\098\042\103\042\110\042\116"))assert(K("\097\098\099\088\100\101\102\088\103\104\105","\042\088\042\105"))assert(K("\102\111\111","\102\111\111"))assert(K("\102\111\111\047\098\097\114","\102\111\111\047\042"))assert(K("\102\111\111\047\098\097\114","\102\111\111\047\098\097\114"))assert(K("\102\111\111\047\098\098\047\097\097\047\114\114","\042\042\047\042\042\047\042\042"))assert(K("\102\111\111\047\098\098\097\047\097\114\114","\042\047\042\047\042"))assert(K("\102\111\111\047\098\098\097\047\097\114\114","\102\111\111\047\042\042"))end)end)end
-- ROBLOX upstream: https://github.com/micromatch/picomatch/tree/2.3.1/test/wildmat.js

return function()
	local CurrentModule = script.Parent
	local PicomatchModule = CurrentModule.Parent

	local isMatch = require(PicomatchModule).isMatch
	describe("Wildmat (git) tests", function()
		it("Basic wildmat features", function()
			assert(not isMatch("foo", "*f"))
			assert(not isMatch("foo", "??"))
			assert(not isMatch("foo", "bar"))
			assert(not isMatch("foobar", "foo\\*bar"))
			assert(isMatch("?a?b", "\\??\\?b"))
			assert(isMatch("aaaaaaabababab", "*ab"))
			assert(isMatch("foo", "*"))
			assert(isMatch("foo", "*foo*"))
			assert(isMatch("foo", "???"))
			assert(isMatch("foo", "f*"))
			assert(isMatch("foo", "foo"))
			assert(isMatch("foobar", "*ob*a*r*"))
		end)

		it("should support recursion", function()
			assert(
				not isMatch(
					"-adobe-courier-bold-o-normal--12-120-75-75-/-70-iso8859-1",
					"-*-*-*-*-*-*-12-*-*-*-m-*-*-*"
				)
			)
			assert(
				not isMatch(
					"-adobe-courier-bold-o-normal--12-120-75-75-X-70-iso8859-1",
					"-*-*-*-*-*-*-12-*-*-*-m-*-*-*"
				)
			)
			assert(not isMatch("ab/cXd/efXg/hi", "*X*i"))
			assert(not isMatch("ab/cXd/efXg/hi", "*Xg*i"))
			assert(not isMatch("abcd/abcdefg/abcdefghijk/abcdefghijklmnop.txtz", "**/*a*b*g*n*t"))
			assert(not isMatch("foo", "*/*/*"))
			assert(not isMatch("foo", "fo"))
			assert(not isMatch("foo/bar", "*/*/*"))
			assert(not isMatch("foo/bar", "foo?bar"))
			assert(not isMatch("foo/bb/aa/rr", "*/*/*"))
			assert(not isMatch("foo/bba/arr", "foo*"))
			assert(not isMatch("foo/bba/arr", "foo**"))
			assert(not isMatch("foo/bba/arr", "foo/*"))
			-- ROBLOX FIXME
			-- assert(not isMatch("foo/bba/arr", "foo/**arr"))
			assert(not isMatch("foo/bba/arr", "foo/**z"))
			assert(not isMatch("foo/bba/arr", "foo/*arr"))
			assert(not isMatch("foo/bba/arr", "foo/*z"))
			assert(
				not isMatch(
					"XXX/adobe/courier/bold/o/normal//12/120/75/75/X/70/iso8859/1",
					"XXX/*/*/*/*/*/*/12/*/*/*/m/*/*/*"
				)
			)
			assert(
				isMatch("-adobe-courier-bold-o-normal--12-120-75-75-m-70-iso8859-1", "-*-*-*-*-*-*-12-*-*-*-m-*-*-*")
			)
			assert(isMatch("ab/cXd/efXg/hi", "**/*X*/**/*i"))
			assert(isMatch("ab/cXd/efXg/hi", "*/*X*/*/*i"))
			assert(isMatch("abcd/abcdefg/abcdefghijk/abcdefghijklmnop.txt", "**/*a*b*g*n*t"))
			assert(isMatch("abcXdefXghi", "*X*i"))
			assert(isMatch("foo", "foo"))
			assert(isMatch("foo/bar", "foo/*"))
			assert(isMatch("foo/bar", "foo/bar"))
			-- ROBLOX FIXME
			-- assert(isMatch("foo/bar", "foo[/]bar"))
			assert(isMatch("foo/bb/aa/rr", "**/**/**"))
			assert(isMatch("foo/bba/arr", "*/*/*"))
			assert(isMatch("foo/bba/arr", "foo/**"))
		end)
	end)
end
