dev

This module contains testcases for its parent module, Data.

See also


-- <nowiki>
-- Unit tests for [[Global Lua Modules/Data]].
-- @see [[Module talk:Data/testcases]]
return {
	main = {
		options = {
			mode   = 'invocation',
			nowiki = true,
		},
		tests = {
			{    'Module:data/testdata|key1|key2|key3', 'testvalue1' },
			{ 'Module:data/testdata|test1|test2|test3',  'testvalue' },
			{    'Dev:Data/testdata|key1|key2|key3', 'testvalue1' },
			{ 'Dev:Data/testdata|test1|test2|test3',  'testvalue' },
		},
	},

	load = {
		options = {
			mode   = 'method',
			nowiki = true,
			unpk   = true,
		},
		tests = {
			-- Old style
			{
				{{ 'Module:data/testdata', 'key1', 'key2', 'key3' }},
				'testvalue1'
			},
			{
				{{ 'Module:data/testdata', 'test1', 'test2', 'test3' }},
				'testvalue'
			},
			{
				{{ 'Dev:Data/testdata', 'key1', 'key2', 'key3' }},
				'testvalue1'
			},
			{
				{{ 'Dev:Data/testdata', 'test1', 'test2', 'test3' }},
				'testvalue'
			},

			-- New style
			{
				{ 'Module:data/testdata', { 'key1', 'key2', 'key3' } },
				'testvalue1'
			},
			{
				{ 'Module:data/testdata', { 'test1', 'test2', 'test3' } },
				'testvalue'
			},
			{
				{ 'Dev:Data/testdata', { 'key1', 'key2', 'key3' } },
				'testvalue1'
			},
			{
				{ 'Dev:Data/testdata', { 'test1', 'test2', 'test3' } },
				'testvalue'
			},
		},
	},

	['Module:data/testdata'] = {
		options = {
			mode   = 'invocation',
			nowiki = true,
		},
		tests = {
			{    'key1|key2|key3', 'testvalue1' },
			{ 'test1|test2|test3',  'testvalue' },
		},
	},
	[':mOdUlE:Data/testdata'] = {
		options = {
			mode   = 'invocation',
			nowiki = true,
		},
		tests = {
			{    'key1|key2|key3', 'testvalue1' },
			{ 'test1|test2|test3',  'testvalue' },
		},
	},
	['Dev:Data/testdata'] = {
		options = {
			mode   = 'invocation',
			nowiki = true,
		},
		tests = {
			{    'key1|key2|key3', 'testvalue1' },
			{ 'test1|test2|test3',  'testvalue' },
		},
	},
}
-- </nowiki>