Skip to content

Commit

Permalink
Merge pull request #258 from iLib-js/testcases_neNP
Browse files Browse the repository at this point in the history
Add testcase to verify ne-NP (Nepali-Nepal)
  • Loading branch information
gouniLee authored Sep 1, 2020
2 parents a023e6b + 3f396af commit f4356e1
Show file tree
Hide file tree
Showing 31 changed files with 3,622 additions and 4 deletions.
2 changes: 1 addition & 1 deletion js/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ limitations under the License.
<property name="jar.ilib" value="ilib.jar"/>
<property name="locales.default" value="en-AU,en-CA,en-GB,en-IN,en-NG,en-PH,en-PK,en-SG,en-US,en-ZA,de-DE,fr-CA,fr-FR,es-AR,es-ES,es-MX,id-ID,it-IT,ja-JP,ko-KR,pt-BR,ru-RU,tr-TR,vi-VN,zxx-XX,zh-Hans-CN,zh-Hant-HK,zh-Hant-TW,zh-Hans-SG"/>
<property name="locales.unittest" value="aa-DJ,af-NA,agq-CM,ak-GH,am-ET,ar-AE,ar-BH,ar-DJ,ar-DZ,ar-EG,ar-IQ,ar-JO,ar-KW,ar-LB,ar-LY,ar-MA,ar-MR,ar-OM,ar-QA,ar-SA,ar-SD,ar-SY,ar-TN,ar-YE,asa-TZ,as-IN,az-Latn-AZ,bas-CM,be-BY,bem-ZM,bg-BG,bh-IN,bm-ML,bn-IN,br-FR,bs-BS,bs-Cyrl-BA,bs-Latn-BA,bs-ME,ca-FR,cic-US,cop-EG,cs-CZ,da-DK,de-AT,de-CH,de-DE,el-GR,en-AM,en-AU,en-CA,en-ET,en-GB,en-GH,en-GM,en-HK,en-IE,en-IN,en-IS,en-KE,en-LK,en-LR,en-MP,en-MW,en-MY,en-NG,en-NZ,en-PA,en-PH,en-PK,en-PR,en-RW,en-SD,en-SG,en-SL,en-TZ,en-UG,en-US,en-ZA,en-ZM,es-AR,es-BO,es-CL,es-CO,es-CR,es-DO,es-EC,es-ES,es-GQ,es-GT,es-HN,es-MX,es-NI,es-PA,es-PE,es-PH,es-PR,es-PY,es-SV,es-US,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Hans-XX,zxx-Hebr-XX,zxx-XX"/>
<property name="keep.these.comments" value="/(\!data|\!loadLocaleData|\!defineLocaleData|\!macro|eslint-)/"/>

<!-- =================================================================== -->
Expand Down
10 changes: 10 additions & 0 deletions js/test/date/testDayOfWeek.js
Original file line number Diff line number Diff line change
Expand Up @@ -2038,5 +2038,15 @@ module.exports.testweekdata = {
test.equal(info.getWeekEndStart(), 6);
test.equal(info.getWeekEndEnd(), 0);
test.done();
},
testWeekData_ne_NP: function(test) {
test.expect(4);
var info = new LocaleInfo("ne-NP");
test.ok(info !== null);

test.equal(info.getFirstDayOfWeek(), 0);
test.equal(info.getWeekEndStart(), 6);
test.equal(info.getWeekEndEnd(), 0);
test.done();
}
}
10 changes: 10 additions & 0 deletions js/test/date/testMeridiems.js
Original file line number Diff line number Diff line change
Expand Up @@ -2039,6 +2039,16 @@ module.exports.testmeridiems = {

test.equal(fmt[0].name, "AM");
test.equal(fmt[1].name, "PM");
test.done();
},
testMeridiem_ne_NP: function(test) {
test.expect(3);
var fmt = DateFmt.getMeridiemsRange({locale:"ne-NP"});
test.ok(fmt !== null);

test.equal(fmt[0].name, "पूर्वाह्न");
test.equal(fmt[1].name, "अपराह्न");

test.done();
}
}
45 changes: 45 additions & 0 deletions js/test/date/testMonthTranslation.js
Original file line number Diff line number Diff line change
Expand Up @@ -7620,6 +7620,51 @@ module.exports.testmonthtranslation = {
test.equal(value[9], "urr.");
test.equal(value[10], "aza.");
test.equal(value[11], "abe.");
test.done();
},
testMonthTranslate_ne_NP: function(test) {
test.expect(24);

// full, long: MMMM
// medium: MMM
// short: M

var value = [], i;
var fmt = new DateFmt({locale:"ne-NP", date:"m", length: "full", useNative:false, timezone:"local"})
for (i=0; i < 12; i++) {
value[i] = fmt.format(DateFactory({month:i+1, type:"gregorian"}));
}
test.equal(value[0], "जनवरी");
test.equal(value[1], "फेब्रुअरी");
test.equal(value[2], "मार्च");
test.equal(value[3], "अप्रिल");
test.equal(value[4], "मे");
test.equal(value[5], "जुन");
test.equal(value[6], "जुलाई");
test.equal(value[7], "अगस्ट");
test.equal(value[8], "सेप्टेम्बर");
test.equal(value[9], "अक्टोबर");
test.equal(value[10], "नोभेम्बर");
test.equal(value[11], "डिसेम्बर");

var fmt = new DateFmt({locale:"ne-NP", date:"m", length: "medium", useNative:false, timezone:"local"})
for (i=0; i < 12; i++) {
value[i] = fmt.format(DateFactory({month:i+1, type:"gregorian"}));
}

test.equal(value[0], "जनवरी");
test.equal(value[1], "फेब्रुअरी");
test.equal(value[2], "मार्च");
test.equal(value[3], "अप्रिल");
test.equal(value[4], "मे");
test.equal(value[5], "जुन");
test.equal(value[6], "जुलाई");
test.equal(value[7], "अगस्ट");
test.equal(value[8], "सेप्टेम्बर");
test.equal(value[9], "अक्टोबर");
test.equal(value[10], "नोभेम्बर");
test.equal(value[11], "डिसेम्बर");

test.done();
}
}
1 change: 1 addition & 0 deletions js/test/date/testSuite.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
<script src="testdatefmt_mr_IN.js"></script>
<script src="testdatefmt_ms_MY.js"></script>
<script src="testdatefmt_nb_NO.js"></script>
<script src="testdatefmt_ne_NP.js"></script>
<script src="testdatefmt_nl_NL.js"></script>
<script src="testdatefmt_or_IN.js"></script>
<script src="testdatefmt_pa_IN.js"></script>
Expand Down
1 change: 1 addition & 0 deletions js/test/date/testSuiteFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ module.exports.files = [
"testdatefmt_mr_IN.js",
"testdatefmt_ms_MY.js",
"testdatefmt_nb_NO.js",
"testdatefmt_ne_NP.js",
"testdatefmt_nl_NL.js",
"testdatefmt_or_IN.js",
"testdatefmt_pa_IN.js",
Expand Down
71 changes: 71 additions & 0 deletions js/test/date/testWeekdayTranslation.js
Original file line number Diff line number Diff line change
Expand Up @@ -11714,6 +11714,77 @@ module.exports.testWeekdayTranslation = {
test.equal(value[4], "O");
test.equal(value[5], "O");
test.equal(value[6], "L");
test.done();
},
testWeekdayTranslationFull_ne_NP: function(test) {
// full -> wide
test.expect(7);
var fmt, value = [], i;
fmt = new DateFmt({locale:"ne-NP", date:"w", length: "full", useNative:false, timezone:"local"})
for (i=0; i < 7; i++) {
value[i] = fmt.format(DateFactory({year: 2015, month: 8, day:i+2, type:"gregorian"}));
}
test.equal(value[0], "आइतबार");
test.equal(value[1], "सोमबार");
test.equal(value[2], "मङ्गलबार");
test.equal(value[3], "बुधबार");
test.equal(value[4], "बिहिबार");
test.equal(value[5], "शुक्रबार");
test.equal(value[6], "शनिबार");
test.done();
},
testWeekdayTranslationLong_ne_NP: function(test) {
// long -> abbreviate
test.expect(7);
var fmt, value = [], i;
fmt = new DateFmt({locale:"ne-NP", date:"w", length: "long", useNative:false, timezone:"local"})
for (i=0; i < 7; i++) {
value[i] = fmt.format(DateFactory({year: 2015, month: 8, day:i+2, type:"gregorian"}));
}
test.equal(value[0], "आइत");
test.equal(value[1], "सोम");
test.equal(value[2], "मङ्गल");
test.equal(value[3], "बुध");
test.equal(value[4], "बिहि");
test.equal(value[5], "शुक्र");
test.equal(value[6], "शनि");

test.done();
},
testWeekdayTranslationMedium_ne_NP: function(test) {
// medium -> short
test.expect(7);
var fmt, value = [], i;
fmt = new DateFmt({locale:"ne-NP", date:"w", length: "medium", useNative:false, timezone:"local"})
for (i=0; i < 7; i++) {
value[i] = fmt.format(DateFactory({year: 2015, month: 8, day:i+2, type:"gregorian"}));
}
test.equal(value[0], "आइत");
test.equal(value[1], "सोम");
test.equal(value[2], "मङ्गल");
test.equal(value[3], "बुध");
test.equal(value[4], "बिहि");
test.equal(value[5], "शुक्र");
test.equal(value[6], "शनि");

test.done();
},
testWeekdayTranslationShort_ne_NP: function(test) {
// short: narrow
test.expect(7);
var fmt, value = [], i;
fmt = new DateFmt({locale:"ne-NP", date:"w", length: "short", useNative:false, timezone:"local"})
for (i=0; i < 7; i++) {
value[i] = fmt.format(DateFactory({year: 2015, month: 8, day:i+2, type:"gregorian"}));
}
test.equal(value[0], "आ");
test.equal(value[1], "सो");
test.equal(value[2], "म");
test.equal(value[3], "बु");
test.equal(value[4], "बि");
test.equal(value[5], "शु");
test.equal(value[6], "श");

test.done();
}
}
4 changes: 2 additions & 2 deletions js/test/date/testcalendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ if (typeof(LocaleInfo) === "undefined") {

module.exports.testcalendar = {
testDefaultCalendar_GregorianCaseAll: function(test) {
test.expect(200);
test.expect(201);

var localeList = ["ar-AE","ar-BH","ar-DJ","ar-DZ","ar-EG","ar-IQ","ar-JO","ar-KW","ar-LB","ar-LY","ar-MA","ar-MR",
"ar-OM","ar-QA","ar-SA","ar-SD","ar-SY","ar-TN","ar-YE","as-IN","az-Latn-AZ","bg-BG","bn-IN","bs-Latn-BA,bs-Latn-ME",
Expand All @@ -34,7 +34,7 @@ module.exports.testcalendar = {
"es-PY","es-SV","es-US","es-UY","es-VE","eu-ES","fi-FI","fr-BE","fr-BF","fr-BJ","fr-CA","fr-CD","fr-CF","fr-CG","fr-CH","fr-CI",
"fr-CM","fr-GQ","fr-DJ","fr-DZ","fr-FR","fr-GA","fr-GN","fr-LB","fr-LU","fr-ML","fr-RW","fr-SN","fr-TG","ga-IE","gl-ES","gu-IN",
"he-IL","hi-IN","hi-SG","hr-HR","hr-ME","hu-HU","hy-AM","id-ID","is-IS","it-CH","it-IT","ja-JP","ka-GE","kk-Cyrl-KZ","km-KH","kn-IN",
"ko-KR","ku-Arab-IQ","ky-KG","lo-LA","lt-LT","lv-LV","mk-MK","ml-IN","mn-Cyrl-MN","mr-IN","ms-MY","ms-SG","nb-NO","nl-BE","nl-NL","pa-IN",
"ko-KR","ku-Arab-IQ","ky-KG","lo-LA","lt-LT","lv-LV","mk-MK","ml-IN","mn-Cyrl-MN","mr-IN","ms-MY","ms-SG","nb-NO","ne-NP","nl-BE","nl-NL","pa-IN",
"pa-PK","pl-PL","pt-AO","pt-BR","pt-GQ","pt-CV","pt-PT","ro-RO","ru-BY","ru-GE","ru-KG","ru-KZ","ru-RU","ru-UA","si-LK",
"sk-SK","sl-SI","sq-AL","sq-ME","sr-Latn-ME","sr-Latn-RS","sv-FI","sv-SE","sw-KE","ta-IN","ta-SG","te-IN","tr-AM","tr-AZ",
"tr-CY","tr-TR","uk-UA","ur-IN","ur-PK","uz-Cyrl-UZ","uz-Latn-UZ","vi-VN","zh-Hans-CN","zh-Hans-SG","zh-Hant-HK",
Expand Down
9 changes: 9 additions & 0 deletions js/test/date/testclock.js
Original file line number Diff line number Diff line change
Expand Up @@ -1830,6 +1830,15 @@ module.exports.testclock = {
var info = new LocaleInfo("eu-ES");
test.ok(info !== null);
test.equal(info.getClock(), 24);
test.done();
},
testClock_ne_NP: function(test) {
test.expect(2);
var info = new LocaleInfo("ne-NP");
test.ok(info !== null);

test.equal(info.getClock(), 24);

test.done();
}
}
Loading

0 comments on commit f4356e1

Please sign in to comment.