Skip to content

Commit

Permalink
Merge pull request #250 from iLib-js/testcases_beBY
Browse files Browse the repository at this point in the history
Add test cases to verify be-BY(Belarusian-Belarus)
  • Loading branch information
gouniLee authored Sep 1, 2020
2 parents f4356e1 + b3396f9 commit 7d8302c
Show file tree
Hide file tree
Showing 31 changed files with 3,558 additions and 3 deletions.
10 changes: 10 additions & 0 deletions js/test/date/testDayOfWeek.js
Original file line number Diff line number Diff line change
Expand Up @@ -1969,6 +1969,16 @@ module.exports.testweekdata = {
test.equal(info.getWeekEndEnd(), 0);
test.done();
},
testWeekData_be_BY: function(test) {
test.expect(4);
var info = new LocaleInfo("be-BY");
test.ok(info !== null);

test.equal(info.getFirstDayOfWeek(), 1);
test.equal(info.getWeekEndStart(), 6);
test.equal(info.getWeekEndEnd(), 0);
test.done();
},
testWeekData_lo_LA: function(test) {
test.expect(4);
var info = new LocaleInfo("lo-LA");
Expand Down
9 changes: 9 additions & 0 deletions js/test/date/testMeridiems.js
Original file line number Diff line number Diff line change
Expand Up @@ -1974,6 +1974,15 @@ module.exports.testmeridiems = {

test.done();
},
testMeridiem_be_BY: function(test) {
test.expect(3);
var fmt = DateFmt.getMeridiemsRange({locale:"be-BY"});
test.ok(fmt !== null);

test.equal(fmt[0].name, "AM");
test.equal(fmt[1].name, "PM");
test.done();
},
testMeridiem_lo_LA: function(test) {
test.expect(3);
var fmt = DateFmt.getMeridiemsRange({locale:"lo-LA"});
Expand Down
25 changes: 25 additions & 0 deletions js/test/date/testMonthTranslation.js
Original file line number Diff line number Diff line change
Expand Up @@ -7317,6 +7317,31 @@ module.exports.testmonthtranslation = {

test.done();
},
testMonthTranslate_be_BY: function(test) {
test.expect(12);

// full, long: MMMM
// short, medium: MM

var value = [], i;
var fmt = new DateFmt({locale:"be-BY", 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], "снежань");
test.done();
},
testMonthTranslate_lo_LA: function(test) {
test.expect(24);

Expand Down
1 change: 1 addition & 0 deletions js/test/date/testSuite.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
<script src="testdatefmt_ar_SA.js"></script>
<script src="testdatefmt_as_IN.js"></script>
<script src="testdatefmt_az_Latn_AZ.js"></script>
<script src="testdatefmt_be_BY.js"></script>
<script src="testdatefmt_bg.js"></script>
<script src="testdatefmt_bn_IN.js"></script>
<script src="testdatefmt_bs_Cyrl_BA.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 @@ -36,6 +36,7 @@ module.exports.files = [
"testdatefmt_ar_SA.js",
"testdatefmt_as_IN.js",
"testdatefmt_az_Latn_AZ.js",
"testdatefmt_be_BY.js",
"testdatefmt_bg.js",
"testdatefmt_bn_IN.js",
"testdatefmt_bs_Cyrl_BA.js",
Expand Down
70 changes: 70 additions & 0 deletions js/test/date/testWeekdayTranslation.js
Original file line number Diff line number Diff line change
Expand Up @@ -11223,6 +11223,76 @@ module.exports.testWeekdayTranslation = {

test.done();
},
testWeekdayTranslationFull_be_BY: function(test) {
// full -> wide
test.expect(7);
var fmt, value = [], i;
fmt = new DateFmt({locale:"be-BY", 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_be_BY: function(test) {
// long -> abbreviate
test.expect(7);
var fmt, value = [], i;
fmt = new DateFmt({locale:"be-BY", 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_be_BY: function(test) {
// medium -> short
test.expect(7);
var fmt, value = [], i;
fmt = new DateFmt({locale:"be-BY", 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_be_BY: function(test) {
// short: narrow
test.expect(7);
var fmt, value = [], i;
fmt = new DateFmt({locale:"be-BY", 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();
},
testWeekdayTranslationFull_lo_LA: function(test) {
// full -> wide
test.expect(7);
Expand Down
4 changes: 2 additions & 2 deletions js/test/date/testcalendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ if (typeof(LocaleInfo) === "undefined") {

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

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",
"ar-OM","ar-QA","ar-SA","ar-SD","ar-SY","ar-TN","ar-YE","as-IN","az-Latn-AZ","be-BY","bg-BG","bn-IN","bs-Latn-BA,bs-Latn-ME",
"ca-AD", "ca-ES", "cs-CZ","da-DK","de-AT","de-CH","de-DE","de-LU","et-EE","el-CY","el-GR","en-AM","en-AU","en-AZ","en-CA","en-GB","en-GH",
"en-GM","en-HK","en-IE","en-IN","en-IS","en-JP","en-KE","en-KR","en-LK","en-LR","en-MM","en-MW","en-MY","en-NG","en-NZ",
"en-PH","en-PK","en-PR","en-RW","en-SD","en-SG","en-SL","en-TW","en-TZ","en-UG","en-US","en-ZA","en-ZM","es-AR","es-BO",
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 @@ -1775,6 +1775,15 @@ module.exports.testclock = {

test.done();
},
testClock_be_BY: function(test) {
test.expect(2);
var info = new LocaleInfo("be-BY");
test.ok(info !== null);

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

test.done();
},
testClock_lo_LA: function(test) {
test.expect(2);
var info = new LocaleInfo("lo-LA");
Expand Down
Loading

0 comments on commit 7d8302c

Please sign in to comment.