Skip to content

Commit

Permalink
Fix unit tests for Unicode NFC
Browse files Browse the repository at this point in the history
  • Loading branch information
mjradwin committed Sep 23, 2021
1 parent 583f7ec commit 214a933
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/HebrewDateEvent.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ test('render', (t) => {
t.is(hd2.render(''), '1st of Tishrei, 5780');
t.is(hd2.render('en'), '1st of Tishrei, 5780');
t.is(hd2.render('ashkenazi'), '1st of Tishrei, 5780');
t.is(hd2.render('he'), 'א׳ תִשְׁרֵי תש״פ');
t.is(hd2.render('he'), 'א׳ תִשְׁרֵי תש״פ');
t.is(elul29.render(), '29th of Elul, 5779');
t.is(elul29.render('en'), '29th of Elul, 5779');
t.is(elul29.render(''), '29th of Elul, 5779');
Expand All @@ -27,7 +27,7 @@ test('render', (t) => {
t.is(tishrei1.render(''), '1st of Tishrei, 5780');
t.is(tishrei1.render('en'), '1st of Tishrei, 5780');
t.is(tishrei1.render('ashkenazi'), '1st of Tishrei, 5780');
t.is(tishrei1.render('he'), '1. תִשְׁרֵי, 5780');
t.is(tishrei1.render('he'), '1. תִשְׁרֵי, 5780');
});

test('renderGematriya', (t) => {
Expand Down
2 changes: 1 addition & 1 deletion src/hdate.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ test('abs2hebrew-88ce', (t) => {

test('renderGematriya', (t) => {
t.is(new HDate(17, 'Tamuz', 5748).renderGematriya(), 'י״ז תַּמּוּז תשמ״ח');
t.is(new HDate(20, 'Tishrei', 5780).renderGematriya(), 'כ׳ תִשְׁרֵי תש״פ');
t.is(new HDate(20, 'Tishrei', 5780).renderGematriya(), 'כ׳ תִשְׁרֵי תש״פ');
});

test('monthFromName', (t) => {
Expand Down
2 changes: 1 addition & 1 deletion src/omer.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class OmerEvent extends Event {
const heWeek = Locale.gettext(week, 'he');
const heDayWithinWeek = Locale.gettext(dayWithinWeek, 'he');
const hePrefix = 'שֶׁבַּ';
this.memo = `${dayWithinWeek} that is in ${week} / ${heDayWithinWeek} ${hePrefix}${heWeek}`;
this.memo = `${dayWithinWeek} that is in ${week} / ${heDayWithinWeek} ${hePrefix}${heWeek}`.normalize();
}
/**
* @todo use gettext()
Expand Down
14 changes: 7 additions & 7 deletions src/omer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,30 +29,30 @@ test('render', (t) => {

test('memo-and-days-weeks', (t) => {
let omer = new OmerEvent(new HDate(16, 'Nisan', 5770), 1);
t.is(omer.memo, 'Lovingkindness that is in Lovingkindness / חֶֽסֶד שֶׁבַּחֶֽסֶד');
t.is(omer.memo, 'Lovingkindness that is in Lovingkindness / חֶֽסֶד שֶׁבַּחֶֽסֶד');
t.is(omer.getTodayIs('en'), 'Today is 1 day of the Omer');

omer = new OmerEvent(new HDate(17, 'Nisan', 5770), 2);
t.is(omer.memo, 'Might that is in Lovingkindness / גְבוּרָה שֶׁבַּחֶֽסֶד');
t.is(omer.memo, 'Might that is in Lovingkindness / גְבוּרָה שֶׁבַּחֶֽסֶד');
t.is(omer.getTodayIs('en'), 'Today is 2 days of the Omer');

omer = new OmerEvent(new HDate(22, 'Nisan', 5770), 7);
t.is(omer.memo, 'Majesty that is in Lovingkindness / מַּלְכוּת שֶׁבַּחֶֽסֶד');
t.is(omer.memo, 'Majesty that is in Lovingkindness / מַּלְכוּת שֶׁבַּחֶֽסֶד');
t.is(omer.getTodayIs('en'), 'Today is 7 days, which is 1 week of the Omer');

omer = new OmerEvent(new HDate(23, 'Nisan', 5770), 8);
t.is(omer.memo, 'Lovingkindness that is in Might / חֶֽסֶד שֶׁבַּגְבוּרָה');
t.is(omer.memo, 'Lovingkindness that is in Might / חֶֽסֶד שֶׁבַּגְבוּרָה');
t.is(omer.getTodayIs('en'), 'Today is 8 days, which is 1 week and 1 day of the Omer');

omer = new OmerEvent(new HDate(28, 'Nisan', 5770), 13);
t.is(omer.memo, 'Foundation that is in Might / יְּסוֹד שֶׁבַּגְבוּרָה');
t.is(omer.memo, 'Foundation that is in Might / יְּסוֹד שֶׁבַּגְבוּרָה');
t.is(omer.getTodayIs('en'), 'Today is 13 days, which is 1 week and 6 days of the Omer');

omer = new OmerEvent(new HDate(29, 'Nisan', 5770), 14);
t.is(omer.memo, 'Majesty that is in Might / מַּלְכוּת שֶׁבַּגְבוּרָה');
t.is(omer.memo, 'Majesty that is in Might / מַּלְכוּת שֶׁבַּגְבוּרָה');
t.is(omer.getTodayIs('en'), 'Today is 14 days, which is 2 weeks of the Omer');

omer = new OmerEvent(new HDate(2, 'Sivan', 5770), 46);
t.is(omer.memo, 'Eternity that is in Majesty / נֶּֽצַח שֶׁבַּמַּלְכוּת');
t.is(omer.memo, 'Eternity that is in Majesty / נֶּֽצַח שֶׁבַּמַּלְכוּת');
t.is(omer.getTodayIs('en'), 'Today is 46 days, which is 6 weeks and 4 days of the Omer');
});

0 comments on commit 214a933

Please sign in to comment.