Jump to content

Module:RQ:pi:Sai Kam Mong/testcases

From Wiktionary, the free dictionary

All tests passed. (refresh)

TextExpectedActual
test_direct:
Passed{{#invoke:RQ:pi:Sai Kam Mong|quote|241|namo|3}}
2004, Sai Kam Mong, The History and Development of the Shan Scripts, Chiang Mai, Thailand: Silkworm Books, →ISBN, →OCLC, page 241:
ᨶᨾᩮᩣᨲᩔ ᨽᨣᩅᨲᩮᩣ ᩋᩁᩉᨲᩮᩣ ᩈᨾᩜᩣᩈᨾ᩠ᨻᩩᨴ᩠ᨵᩔ
namotassa bhagavato arahato sammāsambuddhassa
Honour to the Blessed One, the Exalted One, the fully Enlightened One
2004, Sai Kam Mong, The History and Development of the Shan Scripts, Chiang Mai, Thailand: Silkworm Books, →ISBN, →OCLC, page 241:
ᨶᨾᩮᩣᨲᩔ ᨽᨣᩅᨲᩮᩣ ᩋᩁᩉᨲᩮᩣ ᩈᨾᩜᩣᩈᨾ᩠ᨻᩩᨴ᩠ᨵᩔ
namotassa bhagavato arahato sammāsambuddhassa
Honour to the Blessed One, the Exalted One, the fully Enlightened One
Passed{{#invoke:RQ:pi:Sai Kam Mong|quote|241|namo|7}}
2004, Sai Kam Mong, The History and Development of the Shan Scripts, Chiang Mai, Thailand: Silkworm Books, →ISBN, →OCLC, page 241:
ᨶᨾᩮᩣᨲᩔ ᨽᨣᩅᨲᩮᩣ ᩋᩁᩉᨲᩮᩣ ᩈᨾᩜᩣᩈᨾ᩠ᨻᩩᨴ᩠ᨵᩔ
namotassa bhagavato arahato sammāsambuddhassa
Honour to the Blessed One, the Exalted One, the fully Enlightened One
2004, Sai Kam Mong, The History and Development of the Shan Scripts, Chiang Mai, Thailand: Silkworm Books, →ISBN, →OCLC, page 241:
ᨶᨾᩮᩣᨲᩔ ᨽᨣᩅᨲᩮᩣ ᩋᩁᩉᨲᩮᩣ ᩈᨾᩜᩣᩈᨾ᩠ᨻᩩᨴ᩠ᨵᩔ
namotassa bhagavato arahato sammāsambuddhassa
Honour to the Blessed One, the Exalted One, the fully Enlightened One
Passed{{#invoke:RQ:pi:Sai Kam Mong|quote|241|namo|0}}
2004, Sai Kam Mong, The History and Development of the Shan Scripts, Chiang Mai, Thailand: Silkworm Books, →ISBN, →OCLC, page 241:
ᨶᨾᩮᩣᨲᩔ ᨽᨣᩅᨲᩮᩣ ᩋᩁᩉᨲᩮᩣ ᩈᨾᩜᩣᩈᨾ᩠ᨻᩩᨴ᩠ᨵᩔ
namotassa bhagavato arahato sammāsambuddhassa
Honour to the Blessed One, the Exalted One, the fully Enlightened One
2004, Sai Kam Mong, The History and Development of the Shan Scripts, Chiang Mai, Thailand: Silkworm Books, →ISBN, →OCLC, page 241:
ᨶᨾᩮᩣᨲᩔ ᨽᨣᩅᨲᩮᩣ ᩋᩁᩉᨲᩮᩣ ᩈᨾᩜᩣᩈᨾ᩠ᨻᩩᨴ᩠ᨵᩔ
namotassa bhagavato arahato sammāsambuddhassa
Honour to the Blessed One, the Exalted One, the fully Enlightened One
Passed{{#invoke:RQ:pi:Sai Kam Mong|quote|242|namo|3}}There are no passages from page 242There are no passages from page 242
Passed{{#invoke:RQ:pi:Sai Kam Mong|quote|241|nosuch|3}}No passage dubbed "nosuch" on page 241No passage dubbed "nosuch" on page 241
Passed{{#invoke:RQ:pi:Sai Kam Mong|quote|241|namo}}
2004, Sai Kam Mong, The History and Development of the Shan Scripts, Chiang Mai, Thailand: Silkworm Books, →ISBN, →OCLC, page 241:
ᨶᨾᩮᩣᨲᩔ ᨽᨣᩅᨲᩮᩣ ᩋᩁᩉᨲᩮᩣ ᩈᨾᩜᩣᩈᨾ᩠ᨻᩩᨴ᩠ᨵᩔ
namotassa bhagavato arahato sammāsambuddhassa
Honour to the Blessed One, the Exalted One, the fully Enlightened One
2004, Sai Kam Mong, The History and Development of the Shan Scripts, Chiang Mai, Thailand: Silkworm Books, →ISBN, →OCLC, page 241:
ᨶᨾᩮᩣᨲᩔ ᨽᨣᩅᨲᩮᩣ ᩋᩁᩉᨲᩮᩣ ᩈᨾᩜᩣᩈᨾ᩠ᨻᩩᨴ᩠ᨵᩔ
namotassa bhagavato arahato sammāsambuddhassa
Honour to the Blessed One, the Exalted One, the fully Enlightened One
Passed{{#invoke:RQ:pi:Sai Kam Mong|quote|241}}Passage ID is missingPassage ID is missing
Passed{{#invoke:RQ:pi:Sai Kam Mong|quote|xxx|namo|3}}There are no passages from page xxxThere are no passages from page xxx
Passed{{#invoke:RQ:pi:Sai Kam Mong|quote}}Invalid or missing page numberInvalid or missing page number
TextExpectedActual
test_template:
Passed{{RQ:pi:Sai Kam Mong quote| 241 | namo | 3 }}
2004, Sai Kam Mong, The History and Development of the Shan Scripts, Chiang Mai, Thailand: Silkworm Books, →ISBN, →OCLC, page 241:
ᨶᨾᩮᩣᨲᩔ ᨽᨣᩅᨲᩮᩣ ᩋᩁᩉᨲᩮᩣ ᩈᨾᩜᩣᩈᨾ᩠ᨻᩩᨴ᩠ᨵᩔ
namotassa bhagavato arahato sammāsambuddhassa
Honour to the Blessed One, the Exalted One, the fully Enlightened One
2004, Sai Kam Mong, The History and Development of the Shan Scripts, Chiang Mai, Thailand: Silkworm Books, →ISBN, →OCLC, page 241:
ᨶᨾᩮᩣᨲᩔ ᨽᨣᩅᨲᩮᩣ ᩋᩁᩉᨲᩮᩣ ᩈᨾᩜᩣᩈᨾ᩠ᨻᩩᨴ᩠ᨵᩔ
namotassa bhagavato arahato sammāsambuddhassa
Honour to the Blessed One, the Exalted One, the fully Enlightened One
Passed{{RQ:pi:Sai Kam Mong quote| 241 | namo | 7 }}
2004, Sai Kam Mong, The History and Development of the Shan Scripts, Chiang Mai, Thailand: Silkworm Books, →ISBN, →OCLC, page 241:
ᨶᨾᩮᩣᨲᩔ ᨽᨣᩅᨲᩮᩣ ᩋᩁᩉᨲᩮᩣ ᩈᨾᩜᩣᩈᨾ᩠ᨻᩩᨴ᩠ᨵᩔ
namotassa bhagavato arahato sammāsambuddhassa
Honour to the Blessed One, the Exalted One, the fully Enlightened One
2004, Sai Kam Mong, The History and Development of the Shan Scripts, Chiang Mai, Thailand: Silkworm Books, →ISBN, →OCLC, page 241:
ᨶᨾᩮᩣᨲᩔ ᨽᨣᩅᨲᩮᩣ ᩋᩁᩉᨲᩮᩣ ᩈᨾᩜᩣᩈᨾ᩠ᨻᩩᨴ᩠ᨵᩔ
namotassa bhagavato arahato sammāsambuddhassa
Honour to the Blessed One, the Exalted One, the fully Enlightened One
Passed{{RQ:pi:Sai Kam Mong quote| 241 | namo | 0 }}
2004, Sai Kam Mong, The History and Development of the Shan Scripts, Chiang Mai, Thailand: Silkworm Books, →ISBN, →OCLC, page 241:
ᨶᨾᩮᩣᨲᩔ ᨽᨣᩅᨲᩮᩣ ᩋᩁᩉᨲᩮᩣ ᩈᨾᩜᩣᩈᨾ᩠ᨻᩩᨴ᩠ᨵᩔ
namotassa bhagavato arahato sammāsambuddhassa
Honour to the Blessed One, the Exalted One, the fully Enlightened One
2004, Sai Kam Mong, The History and Development of the Shan Scripts, Chiang Mai, Thailand: Silkworm Books, →ISBN, →OCLC, page 241:
ᨶᨾᩮᩣᨲᩔ ᨽᨣᩅᨲᩮᩣ ᩋᩁᩉᨲᩮᩣ ᩈᨾᩜᩣᩈᨾ᩠ᨻᩩᨴ᩠ᨵᩔ
namotassa bhagavato arahato sammāsambuddhassa
Honour to the Blessed One, the Exalted One, the fully Enlightened One
Passed{{RQ:pi:Sai Kam Mong quote| 242 | namo | 3 }}There are no passages from page 242There are no passages from page 242
Passed{{RQ:pi:Sai Kam Mong quote| 241 | nosuch | 3 }}No passage dubbed "nosuch" on page 241No passage dubbed "nosuch" on page 241
Passed{{RQ:pi:Sai Kam Mong quote| 241 | namo }}
2004, Sai Kam Mong, The History and Development of the Shan Scripts, Chiang Mai, Thailand: Silkworm Books, →ISBN, →OCLC, page 241:
ᨶᨾᩮᩣᨲᩔ ᨽᨣᩅᨲᩮᩣ ᩋᩁᩉᨲᩮᩣ ᩈᨾᩜᩣᩈᨾ᩠ᨻᩩᨴ᩠ᨵᩔ
namotassa bhagavato arahato sammāsambuddhassa
Honour to the Blessed One, the Exalted One, the fully Enlightened One
2004, Sai Kam Mong, The History and Development of the Shan Scripts, Chiang Mai, Thailand: Silkworm Books, →ISBN, →OCLC, page 241:
ᨶᨾᩮᩣᨲᩔ ᨽᨣᩅᨲᩮᩣ ᩋᩁᩉᨲᩮᩣ ᩈᨾᩜᩣᩈᨾ᩠ᨻᩩᨴ᩠ᨵᩔ
namotassa bhagavato arahato sammāsambuddhassa
Honour to the Blessed One, the Exalted One, the fully Enlightened One
Passed{{RQ:pi:Sai Kam Mong quote| 241 }}Passage ID is missingPassage ID is missing
Passed{{RQ:pi:Sai Kam Mong quote | xxx | namo | 3 }}There are no passages from page xxxThere are no passages from page xxx
Passed{{RQ:pi:Sai Kam Mong quote}}Invalid or missing page numberInvalid or missing page number

local tests = require('Module:UnitTests')

function tests:test_direct()
	--[[ here be the tests ]]
-- simple case:
	tests:preprocess_equals_preprocess(
		"{{#invoke:RQ:pi:Sai Kam Mong|quote|241|namo|3}}",
		"{{RQ:pi:Sai Kam Mong|241\n"..
		"|ᨶᨾᩮᩣᨲᩔ '''ᨽᨣᩅᨲᩮᩣ''' ᩋᩁᩉᨲᩮᩣ ᩈᨾᩜᩣᩈᨾ᩠ᨻᩩᨴ᩠ᨵᩔ\n"..
		"|namotassa '''bhagavato''' arahato sammāsambuddhassa\n"..
		"|Honour to the '''Blessed One''', the Exalted One, the fully Enlightened One}}")
-- nested string
	tests:preprocess_equals_preprocess(
		"{{#invoke:RQ:pi:Sai Kam Mong|quote|241|namo|7}}",
		"{{RQ:pi:Sai Kam Mong|241\n"..
		"|ᨶᨾᩮᩣᨲᩔ ᨽᨣᩅᨲᩮᩣ ᩋᩁᩉᨲᩮᩣ '''ᩈᨾᩜᩣᩈᨾ᩠ᨻᩩᨴ᩠ᨵᩔ'''\n"..
		"|namotassa bhagavato arahato '''sammāsambuddhassa'''\n"..
		"|Honour to the Blessed One, the Exalted One, '''the fully Enlightened One'''}}")
-- No highlighting
	tests:preprocess_equals_preprocess(
		"{{#invoke:RQ:pi:Sai Kam Mong|quote|241|namo|0}}",
		"{{RQ:pi:Sai Kam Mong|241\n"..
		"|ᨶᨾᩮᩣᨲᩔ ᨽᨣᩅᨲᩮᩣ ᩋᩁᩉᨲᩮᩣ ᩈᨾᩜᩣᩈᨾ᩠ᨻᩩᨴ᩠ᨵᩔ\n"..
		"|namotassa bhagavato arahato sammāsambuddhassa\n"..
		"|Honour to the Blessed One, the Exalted One, the fully Enlightened One}}")
-- Wrong page
	tests:preprocess_equals(
		"{{#invoke:RQ:pi:Sai Kam Mong|quote|242|namo|3}}",
		"There are no passages from page 242")
-- Wrong ID:
	tests:preprocess_equals_preprocess(
		"{{#invoke:RQ:pi:Sai Kam Mong|quote|241|nosuch|3}}",
		"No passage dubbed \"nosuch\" on page 241")
-- No word specified:
	tests:preprocess_equals_preprocess(
		"{{#invoke:RQ:pi:Sai Kam Mong|quote|241|namo}}",
		"{{#invoke:RQ:pi:Sai Kam Mong|quote|241|namo|0}}")
-- No ID specified:
	tests:preprocess_equals_preprocess(
		"{{#invoke:RQ:pi:Sai Kam Mong|quote|241}}",
		"Passage ID is missing")
-- Page is not a number
	tests:preprocess_equals(
		"{{#invoke:RQ:pi:Sai Kam Mong|quote|xxx|namo|3}}",
		"There are no passages from page xxx")
-- No page number
	tests:preprocess_equals(
		"{{#invoke:RQ:pi:Sai Kam Mong|quote}}",
		"Invalid or missing page number")
end

function tests:test_template()
	--[[ here be the tests ]]
-- simple case:
	tests:preprocess_equals_preprocess(
		"{{RQ:pi:Sai Kam Mong quote| 241 | namo | 3 }}",
		"{{#invoke:RQ:pi:Sai Kam Mong|quote|241|namo|3}}")
-- nested string
	tests:preprocess_equals_preprocess(
		"{{RQ:pi:Sai Kam Mong quote| 241 | namo | 7 }}",
		"{{#invoke:RQ:pi:Sai Kam Mong|quote|241|namo|7}}")
-- No highlighting
	tests:preprocess_equals_preprocess(
		"{{RQ:pi:Sai Kam Mong quote| 241 | namo | 0 }}",
		"{{#invoke:RQ:pi:Sai Kam Mong|quote|241|namo|0}}")
-- Wrong page
	tests:preprocess_equals_preprocess(
		"{{RQ:pi:Sai Kam Mong quote| 242 | namo | 3 }}",
		"{{#invoke:RQ:pi:Sai Kam Mong|quote|242|namo|3}}")
-- Wrong ID:
	tests:preprocess_equals_preprocess(
		"{{RQ:pi:Sai Kam Mong quote| 241 | nosuch | 3 }}",
		"{{#invoke:RQ:pi:Sai Kam Mong|quote|241|nosuch|3}}")
-- No word specified:
	tests:preprocess_equals_preprocess(
		"{{RQ:pi:Sai Kam Mong quote| 241 | namo }}",
		"{{#invoke:RQ:pi:Sai Kam Mong|quote|241|namo}}")
-- No ID specified:
	tests:preprocess_equals_preprocess(
		"{{RQ:pi:Sai Kam Mong quote| 241 }}",
		"{{#invoke:RQ:pi:Sai Kam Mong|quote|241}}")
-- Page is not a number
	tests:preprocess_equals_preprocess(
		"{{RQ:pi:Sai Kam Mong quote | xxx | namo | 3 }}",
		"{{#invoke:RQ:pi:Sai Kam Mong|quote|xxx|namo|3}}")
-- No page number
	tests:preprocess_equals_preprocess(
		"{{RQ:pi:Sai Kam Mong quote}}",
		"{{#invoke:RQ:pi:Sai Kam Mong|quote}}")
end

return tests