Module:sa-convert/testcases

Wiktionary වෙතින්

These tests of the conversion of Sanskrit from Devanagari to other scripts are of two types. The first type checks that a particular form results for a specific script; the second type merely checks that the forms in Devanagari and the other script have the same transliteration to the Roman alphabet. The second type is neither necessary nor sufficient for correctness, but it offers protection against finger trouble in the transliteration.

For the first type of test, the 'text' is the Devanagari text to be transliterated, the 'expected' column is the transliteration that should be produced, and the 'actual' column is what should be produced. For the second type of text, the 'text' column lists the Devanagari original, the script code of the target script, and the transliteration thereinto. The expected column gives the Latin transliteration of the Devanagari, and the actual column gives the Latin transliteration of the text into the other script. For a failed test of either type, the text in the 'expected' and 'actual' columns may be accompanied by a defence of what it is.

Single Script Pages[සංස්කරණය]

The test results for each script may be viewed and updated ('refreshed') individually by following the links below:

Gujarati Javanese Balinese Saurashtra Oriya Assamese Bengali Tirhuta Kannada Telugu Malayalam Tamil Modi Tibetan Siddham Sharada Brahmi Thai Lao Khmer Sinhala Gurmukhi Burmese Cham Prachalit 'Phags-pa Chakma Grantha Kaithi Bhaiksuki Soyombo   Zanabazar Square   Takri   Tai Tham

They may alternative be viewed and updated from the individual scripts' subsections below.

All Scripts Together[සංස්කරණය]

3 of 11 tests failed. (refresh)

TextExpectedActual
test_all:
Passedनिर्वाण Laoo: ນິຣ຺ວາຓnirvāṇanirvāṇa
Passedगङ्गा Laoo: ຄງ຺ຄາgaṅgāgaṅgā
Passedवीर Laoo: ວີຣvīravīra
Passedआचार्यैः Laoo: ອາຈາຣ຺ໄຍະācāryaiḥācāryaiḥ
Passedगोपन Laoo: ໂຄປນgopanagopana
Passedप्राक् Laoo: ປ຺ຣາກ຺prākprāk
Passedक्रोध Laoo: ກ຺ໂຣຘkrodhakrodha
Passedआस्ये Laoo: ອາສ຺ເຍāsyeāsye
Failedसऋक्ष Laoo: ສຣິກ຺ຩsaṛkṣasarikṣa
Failedसंस्कृतम् Laoo: ສໍສ຺ກ຺ຣິຕມ຺saṃskṛtamsaṃskritam
Passedनीळ Laoo: ນີຬnīḷanīḷa
Script error during testing: Module:languages/doSubstitutions:73: Substitution data 'sa-Knda-translit' does not match an existing module or module failed to execute: package.lua:80: module 'Module:sa-Knda-translit' not found.
stack traceback:
	[C]: ?
	[C]: in function 'error'
	Module:languages/doSubstitutions:73: in function 'doSubstitutions'
	Module:languages/doSubstitutions:32: in function <Module:languages/doSubstitutions:25>
	(tail call): ?
	Module:languages:267: in function 'iterateSectionSubstitutions'
	Module:languages:1422: in function 'transliterate'
	Module:sa-convert/testcases:100: in function 'one_script'
	Module:sa-convert/testcases:141: in function <Module:sa-convert/testcases:130>
	(tail call): ?
	[C]: in function 'xpcall'
	Module:UnitTests:369: in function <Module:UnitTests:328>
	(tail call): ?
	mw.lua:527: in function <mw.lua:507>
	[C]: ?
	[C]: in function 'expandTemplate'
	mw.lua:333: in function 'expandTemplate'
	Module:documentation:877: in function 'chunk'
	mw.lua:527: in function <mw.lua:507>
	[C]: ?

Single Script Subsections[සංස්කරණය]

Gujarati[සංස්කරණය]

1 of 0 tests failed. (refresh)

TextExpectedActual
test_one_script:
Script error during testing: Module:languages/doSubstitutions:73: Substitution data 'sa-Gujr-translit' does not match an existing module or module failed to execute: package.lua:80: module 'Module:sa-Gujr-translit' not found.
stack traceback:
	[C]: ?
	[C]: in function 'error'
	Module:languages/doSubstitutions:73: in function 'doSubstitutions'
	Module:languages/doSubstitutions:32: in function <Module:languages/doSubstitutions:25>
	(tail call): ?
	Module:languages:267: in function 'iterateSectionSubstitutions'
	Module:languages:1422: in function 'transliterate'
	Module:sa-convert/testcases:100: in function 'one_script'
	Module:sa-convert/testcases/Gujarati:5: in function <Module:sa-convert/testcases/Gujarati:4>
	(tail call): ?
	[C]: in function 'xpcall'
	Module:UnitTests:369: in function <Module:UnitTests:328>
	(tail call): ?
	mw.lua:527: in function <mw.lua:507>
	[C]: ?
	[C]: in function 'expandTemplate'
	mw.lua:333: in function 'expandTemplate'
	Module:documentation:877: in function 'chunk'
	mw.lua:527: in function <mw.lua:507>
	[C]: ?

Javanese[සංස්කරණය]

1 of 0 tests failed. (refresh)

TextExpectedActual
test_one_script:
Script error during testing: Module:languages/doSubstitutions:73: Substitution data 'sa-Java-translit' does not match an existing module or module failed to execute: package.lua:80: module 'Module:sa-Java-translit' not found.
stack traceback:
	[C]: ?
	[C]: in function 'error'
	Module:languages/doSubstitutions:73: in function 'doSubstitutions'
	Module:languages/doSubstitutions:32: in function <Module:languages/doSubstitutions:25>
	(tail call): ?
	Module:languages:267: in function 'iterateSectionSubstitutions'
	Module:languages:1422: in function 'transliterate'
	Module:sa-convert/testcases:100: in function 'one_script'
	Module:sa-convert/testcases/Javanese:5: in function <Module:sa-convert/testcases/Javanese:4>
	(tail call): ?
	[C]: in function 'xpcall'
	Module:UnitTests:369: in function <Module:UnitTests:328>
	(tail call): ?
	mw.lua:527: in function <mw.lua:507>
	[C]: ?
	[C]: in function 'expandTemplate'
	mw.lua:333: in function 'expandTemplate'
	Module:documentation:877: in function 'chunk'
	mw.lua:527: in function <mw.lua:507>
	[C]: ?

Balinese[සංස්කරණය]

All tests passed. (refresh)

TextExpectedActual
test_one_script:

Saurashtra[සංස්කරණය]

All tests passed. (refresh)

TextExpectedActual
test_one_script:

Oriya[සංස්කරණය]

1 of 0 tests failed. (refresh)

TextExpectedActual
test_one_script:
Script error during testing: Module:languages/doSubstitutions:73: Substitution data 'sa-Orya-translit' does not match an existing module or module failed to execute: package.lua:80: module 'Module:sa-Orya-translit' not found.
stack traceback:
	[C]: ?
	[C]: in function 'error'
	Module:languages/doSubstitutions:73: in function 'doSubstitutions'
	Module:languages/doSubstitutions:32: in function <Module:languages/doSubstitutions:25>
	(tail call): ?
	Module:languages:267: in function 'iterateSectionSubstitutions'
	Module:languages:1422: in function 'transliterate'
	Module:sa-convert/testcases:100: in function 'one_script'
	Module:sa-convert/testcases/Oriya:5: in function <Module:sa-convert/testcases/Oriya:4>
	(tail call): ?
	[C]: in function 'xpcall'
	Module:UnitTests:369: in function <Module:UnitTests:328>
	(tail call): ?
	mw.lua:527: in function <mw.lua:507>
	[C]: ?
	[C]: in function 'expandTemplate'
	mw.lua:333: in function 'expandTemplate'
	Module:documentation:877: in function 'chunk'
	mw.lua:527: in function <mw.lua:507>
	[C]: ?

Assamese[සංස්කරණය]

1 of 0 tests failed. (refresh)

TextExpectedActual
test_one_script:
Script error during testing: Module:languages/doSubstitutions:73: Substitution data 'sa-Beng-translit' does not match an existing module or module failed to execute: package.lua:80: module 'Module:sa-Beng-translit' not found.
stack traceback:
	[C]: ?
	[C]: in function 'error'
	Module:languages/doSubstitutions:73: in function 'doSubstitutions'
	Module:languages/doSubstitutions:32: in function <Module:languages/doSubstitutions:25>
	(tail call): ?
	Module:languages:267: in function 'iterateSectionSubstitutions'
	Module:languages:1422: in function 'transliterate'
	Module:sa-convert/testcases:100: in function 'one_script'
	Module:sa-convert/testcases/Assamese:5: in function <Module:sa-convert/testcases/Assamese:4>
	(tail call): ?
	[C]: in function 'xpcall'
	Module:UnitTests:369: in function <Module:UnitTests:328>
	(tail call): ?
	mw.lua:527: in function <mw.lua:507>
	[C]: ?
	[C]: in function 'expandTemplate'
	mw.lua:333: in function 'expandTemplate'
	Module:documentation:877: in function 'chunk'
	mw.lua:527: in function <mw.lua:507>
	[C]: ?

Bengali[සංස්කරණය]

2 of 1 test failed. (refresh)

TextExpectedActual
test_one_script:
Failedनिर्वाणনির্ব্বাণ
(Commenting on Mason's citation of the spelling of the word as निरव्वान on p10 of Kaccayano's Pali Gramar, Mazard comments in a footnote in his edition of the work, "Mason here follows the Bangladeshi convention, doubling the v in nirvana. This is not commonly found today in either Romanized or Devanagari Sanskrit, but remains the norm in the classical Bengali typeset (Sadhubasa)--a relatively recent development in the presses of Mason's day (owed to Sir Charles Wilkins).")
নির্বাণ
(Modern Bengali writes নির্বাণ.)
Script error during testing: Module:languages/doSubstitutions:73: Substitution data 'sa-Beng-translit' does not match an existing module or module failed to execute: package.lua:80: module 'Module:sa-Beng-translit' not found.
stack traceback:
	[C]: ?
	[C]: in function 'error'
	Module:languages/doSubstitutions:73: in function 'doSubstitutions'
	Module:languages/doSubstitutions:32: in function <Module:languages/doSubstitutions:25>
	(tail call): ?
	Module:languages:267: in function 'iterateSectionSubstitutions'
	Module:languages:1422: in function 'transliterate'
	Module:sa-convert/testcases:100: in function 'one_script'
	Module:sa-convert/testcases/Bengali:5: in function <Module:sa-convert/testcases/Bengali:4>
	(tail call): ?
	[C]: in function 'xpcall'
	Module:UnitTests:369: in function <Module:UnitTests:328>
	(tail call): ?
	mw.lua:527: in function <mw.lua:507>
	[C]: ?
	[C]: in function 'expandTemplate'
	mw.lua:333: in function 'expandTemplate'
	Module:documentation:877: in function 'chunk'
	mw.lua:527: in function <mw.lua:507>
	[C]: ?

Tirhuta[සංස්කරණය]

All tests passed. (refresh)

TextExpectedActual
test_one_script:

Kannada[සංස්කරණය]

1 of 0 tests failed. (refresh)

TextExpectedActual
test_one_script:
Script error during testing: Module:languages/doSubstitutions:73: Substitution data 'sa-Knda-translit' does not match an existing module or module failed to execute: package.lua:80: module 'Module:sa-Knda-translit' not found.
stack traceback:
	[C]: ?
	[C]: in function 'error'
	Module:languages/doSubstitutions:73: in function 'doSubstitutions'
	Module:languages/doSubstitutions:32: in function <Module:languages/doSubstitutions:25>
	(tail call): ?
	Module:languages:267: in function 'iterateSectionSubstitutions'
	Module:languages:1422: in function 'transliterate'
	Module:sa-convert/testcases:100: in function 'one_script'
	Module:sa-convert/testcases/Kannada:5: in function <Module:sa-convert/testcases/Kannada:4>
	(tail call): ?
	[C]: in function 'xpcall'
	Module:UnitTests:369: in function <Module:UnitTests:328>
	(tail call): ?
	mw.lua:527: in function <mw.lua:507>
	[C]: ?
	[C]: in function 'expandTemplate'
	mw.lua:333: in function 'expandTemplate'
	Module:documentation:877: in function 'chunk'
	mw.lua:527: in function <mw.lua:507>
	[C]: ?

Telugu[සංස්කරණය]

1 of 0 tests failed. (refresh)

TextExpectedActual
test_one_script:
Script error during testing: Module:languages/doSubstitutions:73: Substitution data 'sa-Telu-translit' does not match an existing module or module failed to execute: package.lua:80: module 'Module:sa-Telu-translit' not found.
stack traceback:
	[C]: ?
	[C]: in function 'error'
	Module:languages/doSubstitutions:73: in function 'doSubstitutions'
	Module:languages/doSubstitutions:32: in function <Module:languages/doSubstitutions:25>
	(tail call): ?
	Module:languages:267: in function 'iterateSectionSubstitutions'
	Module:languages:1422: in function 'transliterate'
	Module:sa-convert/testcases:100: in function 'one_script'
	Module:sa-convert/testcases/Telugu:5: in function <Module:sa-convert/testcases/Telugu:4>
	(tail call): ?
	[C]: in function 'xpcall'
	Module:UnitTests:369: in function <Module:UnitTests:328>
	(tail call): ?
	mw.lua:527: in function <mw.lua:507>
	[C]: ?
	[C]: in function 'expandTemplate'
	mw.lua:333: in function 'expandTemplate'
	Module:documentation:877: in function 'chunk'
	mw.lua:527: in function <mw.lua:507>
	[C]: ?

Malayalam[සංස්කරණය]

1 of 0 tests failed. (refresh)

TextExpectedActual
test_one_script:
Script error during testing: Module:languages/doSubstitutions:73: Substitution data 'sa-Mlym-translit' does not match an existing module or module failed to execute: package.lua:80: module 'Module:sa-Mlym-translit' not found.
stack traceback:
	[C]: ?
	[C]: in function 'error'
	Module:languages/doSubstitutions:73: in function 'doSubstitutions'
	Module:languages/doSubstitutions:32: in function <Module:languages/doSubstitutions:25>
	(tail call): ?
	Module:languages:267: in function 'iterateSectionSubstitutions'
	Module:languages:1422: in function 'transliterate'
	Module:sa-convert/testcases:100: in function 'one_script'
	Module:sa-convert/testcases/Malayalam:5: in function <Module:sa-convert/testcases/Malayalam:4>
	(tail call): ?
	[C]: in function 'xpcall'
	Module:UnitTests:369: in function <Module:UnitTests:328>
	(tail call): ?
	mw.lua:527: in function <mw.lua:507>
	[C]: ?
	[C]: in function 'expandTemplate'
	mw.lua:333: in function 'expandTemplate'
	Module:documentation:877: in function 'chunk'
	mw.lua:527: in function <mw.lua:507>
	[C]: ?

Tamil[සංස්කරණය]

All tests passed. (refresh)

TextExpectedActual
test_one_script:

Modi[සංස්කරණය]

1 of 0 tests failed. (refresh)

TextExpectedActual
test_one_script:
Script error during testing: Module:languages/doSubstitutions:73: Substitution data 'sa-Modi-translit' does not match an existing module or module failed to execute: package.lua:80: module 'Module:sa-Modi-translit' not found.
stack traceback:
	[C]: ?
	[C]: in function 'error'
	Module:languages/doSubstitutions:73: in function 'doSubstitutions'
	Module:languages/doSubstitutions:32: in function <Module:languages/doSubstitutions:25>
	(tail call): ?
	Module:languages:267: in function 'iterateSectionSubstitutions'
	Module:languages:1422: in function 'transliterate'
	Module:sa-convert/testcases:100: in function 'one_script'
	Module:sa-convert/testcases/Modi:5: in function <Module:sa-convert/testcases/Modi:4>
	(tail call): ?
	[C]: in function 'xpcall'
	Module:UnitTests:369: in function <Module:UnitTests:328>
	(tail call): ?
	mw.lua:527: in function <mw.lua:507>
	[C]: ?
	[C]: in function 'expandTemplate'
	mw.lua:333: in function 'expandTemplate'
	Module:documentation:877: in function 'chunk'
	mw.lua:527: in function <mw.lua:507>
	[C]: ?

Tibetan[සංස්කරණය]

11 of 11 tests failed. (refresh)

TextExpectedActual
test_one_script:
Failedनिर्वाण Tibt: ནི་རྭཱ་ཎnirvāṇani rwā ṇa
Failedगङ्गा Tibt: ག་ངྒཱgaṅgāga nggā
Failedवीर Tibt: ཝཱི་རvīrawī ra
Failedआचार्यैः Tibt: ཨཱ་ཙཱ་རྱཻཿācāryaiḥā tsā ryaiḥ
Failedगोपन Tibt: གོ་པ་ནgopanago pa na
Failedप्राक् Tibt: པྲཱ་ཀ྄prākprā k
Failedक्रोध Tibt: ཀྲོ་དྷkrodhakro dha
Failedआस्ये Tibt: ཨཱ་སྱེāsyeā sye
Failedसऋक्ष Tibt: ས་རྀ་ཀྵsaṛkṣasa ṛ kṣa
Failedसंस्कृतम् Tibt: སཾ་སྐྲྀ་ཏ་མ྄saṃskṛtamsaṃ skṛ ta m
Failedनीळ Tibt: ནཱིळnīḷanīळ

Siddham[සංස්කරණය]

All tests passed. (refresh)

TextExpectedActual
test_one_script:

Sharada[සංස්කරණය]

All tests passed. (refresh)

TextExpectedActual
test_one_script:

Brahmi[සංස්කරණය]

All tests passed. (refresh)

TextExpectedActual
test_one_script:
Passedनिर्वाण Brah: 𑀦𑀺𑀭𑁆𑀯𑀸𑀡nirvāṇanirvāṇa
Passedगङ्गा Brah: 𑀕𑀗𑁆𑀕𑀸gaṅgāgaṅgā
Passedवीर Brah: 𑀯𑀻𑀭vīravīra
Passedआचार्यैः Brah: 𑀆𑀘𑀸𑀭𑁆𑀬𑁃𑀂ācāryaiḥācāryaiḥ
Passedगोपन Brah: 𑀕𑁄𑀧𑀦gopanagopana
Passedप्राक् Brah: 𑀧𑁆𑀭𑀸𑀓𑁆prākprāk
Passedक्रोध Brah: 𑀓𑁆𑀭𑁄𑀥krodhakrodha
Passedआस्ये Brah: 𑀆𑀲𑁆𑀬𑁂āsyeāsye
Passedसऋक्ष Brah: 𑀲𑀋𑀓𑁆𑀱saṛkṣasaṛkṣa
Passedसंस्कृतम् Brah: 𑀲𑀁𑀲𑁆𑀓𑀾𑀢𑀫𑁆saṃskṛtamsaṃskṛtam
Passedनीळ Brah: 𑀦𑀻𑀴nīḷanīḷa

Thai[සංස්කරණය]

1 of 11 tests failed. (refresh)

TextExpectedActual
test_one_script:
Passedनिर्वाण Thai: นิรฺวาณnirvāṇanirvāṇa
Passedगङ्गा Thai: คงฺคาgaṅgāgaṅgā
Passedवीर Thai: วีรvīravīra
Passedआचार्यैः Thai: อาจารฺไยะācāryaiḥācāryaiḥ
Passedगोपन Thai: โคปนgopanagopana
Passedप्राक् Thai: ปฺรากฺprākprāk
Failedक्रोधโกฺรธ
(RID gives etymology of โกรธ as "ส. โกฺรธ".)
กฺโรธ
Passedआस्ये Thai: อาสฺเยāsyeāsye
Passedसऋक्ष Thai: สฤกฺษsaṛkṣasaṛkṣa
Passedसंस्कृतम् Thai: สํสฺกฺฤตมฺsaṃskṛtamsaṃskṛtam
Passedनीळ Thai: นีฬnīḷanīḷa

Lao[සංස්කරණය]

2 of 11 tests failed. (refresh)

TextExpectedActual
test_one_script:
Passedनिर्वाण Laoo: ນິຣ຺ວາຓnirvāṇanirvāṇa
Passedगङ्गा Laoo: ຄງ຺ຄາgaṅgāgaṅgā
Passedवीर Laoo: ວີຣvīravīra
Passedआचार्यैः Laoo: ອາຈາຣ຺ໄຍະācāryaiḥācāryaiḥ
Passedगोपन Laoo: ໂຄປນgopanagopana
Passedप्राक् Laoo: ປ຺ຣາກ຺prākprāk
Passedक्रोध Laoo: ກ຺ໂຣຘkrodhakrodha
Passedआस्ये Laoo: ອາສ຺ເຍāsyeāsye
Failedसऋक्ष Laoo: ສຣິກ຺ຩsaṛkṣasarikṣa
Failedसंस्कृतम् Laoo: ສໍສ຺ກ຺ຣິຕມ຺saṃskṛtamsaṃskritam
Passedनीळ Laoo: ນີຬnīḷanīḷa

Khmer[සංස්කරණය]

All tests passed. (refresh)

TextExpectedActual
test_one_script:
Passedनिर्वाण Khmr: និវ៌ាណnirvāṇanirvāṇa
Passedगङ्गा Khmr: គង្គាgaṅgāgaṅgā
Passedवीर Khmr: វីរvīravīra
Passedआचार्यैः Khmr: អាចាយ៌ៃះācāryaiḥācāryaiḥ
Passedगोपन Khmr: គោបនgopanagopana
Passedप्राक् Khmr: ប្រាក៑prākprāk
Passedक्रोध Khmr: ក្រោធkrodhakrodha
Passedआस्ये Khmr: អាស្យេāsyeāsye
Passedसऋक्ष Khmr: សឫក្ឞsaṛkṣasaṛkṣa
Passedसंस्कृतम् Khmr: សំស្ក្ឫតម៑saṃskṛtamsaṃskṛtam
Passedनीळ Khmr: នីឡnīḷanīḷa

Sinhala[සංස්කරණය]

3 of 11 tests failed. (refresh)

TextExpectedActual
test_one_script:
Passedनिर्वाण Sinh: නිර්වාණnirvāṇanirvāṇa
Passedगङ्गा Sinh: ගඞ්ගාgaṅgāgaṅgā
Passedवीर Sinh: වීරvīravīra
Passedआचार्यैः Sinh: ආචාර්යෛඃācāryaiḥācāryaiḥ
Failedगोपन Sinh: ගෝපනgopanagōpana
Passedप्राक् Sinh: ප්රාක්prākprāk
Failedक्रोध Sinh: ක්රෝධkrodhakrōdha
Failedआस्ये Sinh: ආස්යේāsyeāsyē
Passedसऋक्ष Sinh: සඍක්ෂsaṛkṣasaṛkṣa
Passedसंस्कृतम् Sinh: සංස්කෘතම්saṃskṛtamsaṃskṛtam
Passedनीळ Sinh: නීළnīḷanīḷa

Gurmukhi[සංස්කරණය]

All tests passed. (refresh)

TextExpectedActual
test_one_script:

Burmese[සංස්කරණය]

All tests passed. (refresh)

TextExpectedActual
test_one_script:
Passedनिर्वाण Mymr: နိရွာဏnirvāṇanirvāṇa
Passedगङ्गाဂင်္ဂါဂင်္ဂါ
Passedवीर Mymr: ဝီရvīravīra
Passedआचार्यैः Mymr: အာစာရျဲးācāryaiḥācāryaiḥ
Passedव्यञ्जन Mymr: ဝျဉ္ဇနvyañjanavyañjana
Passedगोपनဂေါပနဂေါပန
Passedप्राक्ပြာက်ပြာက်
Passedक्रोध Mymr: ကြောဓkrodhakrodha
Passedआस्ये Mymr: အာသျေāsyeāsye
Passedसऋक्ष Mymr: သၒက္ၑsaṛkṣasaṛkṣa
Passedसंस्कृतम् Mymr: သံသ္ကၖတမ်saṃskṛtamsaṃskṛtam
Passedनीळ Mymr: နီဠnīḷanīḷa

Cham[සංස්කරණය]

All tests passed. (refresh)

TextExpectedActual
test_one_script:

Prachalit[සංස්කරණය]

The Prachalit script is termed the Newa script by Unicode. All tests passed. (refresh)

TextExpectedActual
test_one_script:

'Phags-pa[සංස්කරණය]

All tests passed. (refresh)

TextExpectedActual
test_one_script:

Chakma[සංස්කරණය]

All tests passed. (refresh)

TextExpectedActual
test_one_script:

Grantha[සංස්කරණය]

All tests passed. (refresh)

TextExpectedActual
test_one_script:

Kaithi[සංස්කරණය]

All tests passed. (refresh)

TextExpectedActual
test_one_script:

Bhaiksuki[සංස්කරණය]

All tests passed. (refresh)

TextExpectedActual
test_one_script:

Soyombo[සංස්කරණය]

All tests passed. (refresh)

TextExpectedActual
test_one_script:

Zanabazar Square[සංස්කරණය]

All tests passed. (refresh)

TextExpectedActual
test_one_script:

Takri[සංස්කරණය]

All tests passed. (refresh)

TextExpectedActual
test_one_script:

Tai Tham[සංස්කරණය]

All tests passed. (refresh)

TextExpectedActual
test_one_script:

local tests = require('Module:UnitTests')
local tr = require('Module:sa-convert').tr
local m_languages = require("Module:languages")
local lang = m_languages.getByCode("sa")
local m_scripts = require("Module:scripts")
local deva_sc = m_scripts.getByCode("Deva")
local pali_fallback -- for transliteration.

-- A single letter field is the principal transliteration to the script, encoded as the lowercase letter usable for Template pi-alt.
-- (No transliteration, no test.)  An explanation for the choice of transliteration may be given in the field whose name is formed
-- by suffix '_just', e.g fields 'l' and 'l_just' for the script encoded as 'Lana'.  The explanation is printed out if the test is
-- deemed to have failed.

-- The cases are defined by the following fields:
-- Deva: The Devanagari form of the word; this is the input to the transliteration.
-- Beng etc.: The result of transliterating to that script code.  The following special script codes are
--            used: as-Beng.  The special value "except" may be used to suppress the use of this test when
--            the field all is supplied.  The special value "fakeit" will result in a test for that
--            script as though the filed all had been supplied.
-- all: If this field is defined, the test is performed for all 'supported' scripts.  In this case, if the
--      test reult is not defined for a script, the
--      test is the usually weaker test that the Devanagari and the transliteration transliterate to the
--      Latin script the same.  Note that this fallback test may wrongly fail for the Bengali and Lao
--      scripts, so the required value of "except" exceptionally disables the test.
-- Beng_why etc.: Justification for the required result being what it is.
-- Beng_whynot etc.: Counter-argument.  This is intended for setting out an argument for the test being
--                     wrong until the some form of consensus is arrived at.
-- link: Whether the non-Latin forms should be made into links.
-- aborts: Whether there is a significant link of a conversion error causing the test as a whole
--         to halt.  Such cases are processed after the others.

local cases = {
-- The first case, which may get commented out, is an example of how the test cases are set out.
	{
		Deva="निर्वाण", all=1, link = true,
		Beng="নির্ব্বাণ",
		Beng_why="Commenting on Mason's citation of the spelling of the word as निरव्वान on p10 of "..
		"Kaccayano's Pali Gramar, Mazard comments in a footnote in his edition of the work, "..
		'"Mason here follows the Bangladeshi convention, doubling the v in nirvana. This is not '..
		'commonly found today in either Romanized or Devanagari Sanskrit, but remains the norm '..
		'in the classical Bengali typeset (Sadhubasa)--a relatively recent development in the '..
		"presses of Mason's day (owed to Sir Charles Wilkins)."..'"',
		Beng_whynot="Modern Bengali writes নির্বাণ.",
	},
-- Burmese spelling of the above is rare and highly variable on the web!
	{ Deva = "गङ्गा", all=1, Mymr="ဂင်္ဂါ", link=true},
	{ Deva="वीर", ["as-Beng"]="ৱীৰ", Beng="বীর", all=1, link=true},
	{ Deva="आचार्यैः", all=1, link=true},
	{ Deva="व्यञ्जन", ["as-Beng"]="fakeit", Beng="except", Mymr="fakeit", link=true},
	{ Deva="गोपन", all=1, link=true, Mymr="ဂေါပန"},
	{ Deva="प्राक्", all=1, link=true, Mymr="ပြာက်"},
	{ Deva="क्रोध", all=1, link=true, Thai="โกฺรธ",
		Thai_why='RID gives etymology of โกรธ as "ส. โกฺรธ".' },
	{ Deva="आस्ये", all=1, link=true},
	{ Deva='सऋक्ष', all=1, link=true},
	{ Deva="संस्कृतम्", all=1, Java="ꦱꦁꦱ꧀ꦏꦽꦠꦩ꧀", link=true,
		Java_why="See side panel at https://jv.wikipedia.org/wiki/Basa_Sangsekerta"},
	{ Deva="नीळ", all=1, link=true},
}

--[[ here be the tests ]]
function tests:one_script(sc_name, risk_end)
	local sc = m_scripts.getByCode(sc_name)
	risk_end = not not risk_end -- Canonicalise
	for _, case in pairs(cases) do
		if risk_end == not not case.aborts then
			local name, should, doit, just, counter, nocando
			should = case[sc_name]
			if should then
				if should == "except" then
					doit = false
				elseif should == "fakeit" then
					doit = true
					should = nil
				else
					doit = true
				end
			else
				doit = case.all
			end
			if doit then
				local lp
				just = case[sc_name.."_why"]
				counter = case[sc_name.."_whynot"]
				res = tr(case.Deva, sc_name)
				if case.link then
					lp = "{{l|sa|tr=-|"
				else
					lp = "{lang|sa|"
				end
-- equals(name, actual, expected, options)
				if res == nil or res == "" then
					doit = false
				elseif should then
					name = self.frame:preprocess(lp..case.Deva.."}}")
					should = self.frame:preprocess(lp..should.."}}")
					res = self.frame:preprocess(lp..res.."}}")
				else
					local deva_romn = lang:transliterate(case.Deva, deva_sc)
					local sc_romn   = lang:transliterate(res, sc)
					if not sc_romn or sc_romn == "" and deva_romn ~= "" then
						pali_fallback = pali_fallback or require("Module:pi-translit").tr
						sc_romn = pali_fallback(res, lang, sc_name)
					end
					if not sc_romn or sc_romn == "" and deva_romn ~= "" then
						doit = false; -- silently don't apply a test.
					else
						name = self.frame:preprocess(
							lp..case.Deva.."}} "..sc_name..": "..lp..res.."}}")
						res = sc_romn
						should = deva_romn
					end
				end
				if doit then
					if res ~= should then
						if just then
							should = should.."<br>("..just..")"
						end
						if counter then
							res = res.."<br>("..counter..")"
						end
					end
					tests:equals(name, res, should)
				end
			end
		end
	end
end

function tests:test_all()
	local availableScripts = lang:getScripts()
	local scripts = {}
	for _, script in pairs(availableScripts) do
		scripts[script:getCode()] = 1;
	end
-- New scripts can be added here.
--	{Beng = 1, Mymr = 1, Thai = 1, ["as-Beng"] = 1}
	scripts.Deva = nil; -- Pointless and unsupported to boot.
	for _, risk_all in pairs({false, true}) do
		for sc, _ in pairs(scripts) do
			tests:one_script(sc, risk_all)
		end
	end
end

return tests
"https://si.wiktionary.org/w/index.php?title=Module:sa-convert/testcases&oldid=30199" වෙතින් සම්ප්‍රවේශනය කෙරිණි