Module:Region topic/testcases

From Wikipedia, the free encyclopedia
--This module returns a set of testcases for [[Module:Region topic]].
--See its output on its talk page.

local p = {}

local function navbox(frame,data)
	local args = frame.args
	if args.list then
		return require("Module:Region topic").luaList(frame,data)
	else
		args.name = "Module:Region topic/testcases"
		args.data = data
		return require("Module:Region topic").luaMain(frame,args)
	end
end

function p.data1(frame)
	return navbox(frame,{
		region = "World",
		region_the = true,
		group1 = {
			name = "Sovereign states",
			data = {
				{"AF","Afghanistan",switch="Asia"},
				{"BS","Bahamas",the=true},
				{"DK","Denmark"},
				{"EG","Egypt",hidden=true,switch="Africa"},
				{"FJ","Fiji"},
				{"GB","United Kingdom",the=true,subgroup={
					{"ENG","England"},
					{"NIR","Northern Ireland"},
					{"SCT","Scotland"},
					{"WLS","Wales"},
					hidden=true,switch="UKCC"}},
				{"GE","Georgia",link="Georgia (country)",switch="Asia"},
				{"KH","Cambodia",switch="Asia"},
				{"MK","Macedonia",link="North Macedonia",the=true}
			}
		},
		group2 = {
			name = "[[List of states with limited recognition|States with limited recognition]]",
			data = {
				{"XKS","Kosovo"},
				{"XNC","Northern Cyprus"},
				{"XSD","Somaliland",hidden=true,switch="Africa"},
				{"XSO","South Ossetia",switch="Asia"}
			}
		},
		group3 = {
			name = "{{red|Other territories}}",
			data = {
				{"AI","Anguilla"},
				{"AQ","Antarctica",noredlink=true},
				{"VG","British Virgin Islands",the=true},
				{"GL","Greenland"},
				{"MO","Macau",switch="Asia"}
			},
			switch = "deps"
		},
		group4 = {
			name = "Switchable hidden group",
			data = {
				{"AA","AA"},
				{"AB","AB"},
				{"AC","AC"}
			},
			switch = "foo",
			hidden = true
		},
		group5 = {
			name = "Switchable hidden group 2",
			data = {
				{"XW",switch="show_XW"},
				{"XX",switch="show_XX",hidden=true},
				{"XY",switch="hide_XY",negate_switch=true},
				{"XZ",switch="hide_XZ",hidden=true,negate_switch=true}
			},
			switch = "foo_hidden",
			negate_switch = true,
			hidden = true
		}
	})
end

return p