local k=import("\046\047\102\117\110\099\116\105\111\110\115\047\116\121\112\101\111\102")local s=import("\046\047\099\114\101\097\116\101\069\110\117\109")local b=import("\046\047\099\114\101\097\116\101\069\110\117\109\071\114\111\117\112")describe("\099\114\101\097\116\101\069\110\117\109\071\114\111\117\112",function()it("\115\104\111\117\108\100 \115\116\114\105\110\103\105\102\121 \097\115 \'\069\110\117\109\115\'",function()local k=b({})assert.equal(tostring(k),"\069\110\117\109\115")end)it("\115\104\111\117\108\100 \104\097\118\101 \116\121\112\101 \'\069\110\117\109\115\'",function()local s=b({})assert.equal(k(s),"\069\110\117\109\115")end)it("\115\104\111\117\108\100 \099\111\110\116\097\105\110 \097\108\108 \105\110\112\117\116 \101\110\117\109\115",function()local k=s("\070\111\111",{})local L=b({Foo=k})assert.equal(L.Foo,k)end)it("\115\104\111\117\108\100 \116\104\114\111\119 \119\104\101\110 \112\097\115\115\105\110\103 \110\111\110-\101\110\117\109 \118\097\108\117\101\115 \105\110",function()assert.has.errors(function()b({something={}})end)end)it("\115\104\111\117\108\100 \116\104\114\111\119 \119\104\101\110 \105\110\100\101\120\105\110\103 \119\105\116\104 \117\110\107\110\111\119\110 \107\101\121\115",function()local k=b({})assert.has.errors(function()tostring(k.whatever)end)end)end)
local typeof = import("./functions/typeof")
local createEnum = import("./createEnum")

local createEnumGroup = import("./createEnumGroup")

describe("createEnumGroup", function()
	it("should stringify as 'Enums'", function()
		local group = createEnumGroup({})

		assert.equal(tostring(group), "Enums")
	end)

	it("should have type 'Enums'", function()
		local group = createEnumGroup({})

		assert.equal(typeof(group), "Enums")
	end)

	it("should contain all input enums", function()
		local Foo = createEnum("Foo", {})
		local group = createEnumGroup({
			Foo = Foo,
		})

		assert.equal(group.Foo, Foo)
	end)

	it("should throw when passing non-enum values in", function()
		assert.has.errors(function()
			createEnumGroup({
				something = {},
			})
		end)
	end)

	it("should throw when indexing with unknown keys", function()
		local group = createEnumGroup({})

		assert.has.errors(function()
			tostring(group.whatever)
		end)
	end)
end)