Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zfletch committed Apr 30, 2021
1 parent b1ddc69 commit a64a349
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ jobs:
- name: Lint code
run: yarn lint

- name: Audit dependencies
run: yarn audit
# - name: Audit dependencies
# run: yarn audit

- name: Run tests
run: yarn test
15 changes: 12 additions & 3 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ describe('#greekToBetaCode', () => {
expect(bc.greekToBetaCode(greek)).to.equal(betaCode);
});

it('should convert characters with many diacritics', () => {
const greek = 'ᾧᾯ';
const betaCode = 'w(=|*(=w|';

expect(bc.greekToBetaCode(greek)).to.equal(betaCode);
});

it('should normalize the Unicode', () => {
const greek = 'Πολλὴ μὲν ἐν βροτοῖσι κοὐκ ἀνώνυμος θεὰ κέκλημαι Κύπρις οὐρανοῦ τ᾿ ἔσω·';
const betaCode = '*pollh\\ me\\n e)n brotoi=si kou)k a)nw/numos qea\\ ke/klhmai *ku/pris ou)ranou= t᾿ e)/sw:';
Expand Down Expand Up @@ -78,12 +85,14 @@ describe('#betaCodeToGreek', () => {
});

it('should convert characters with different capitalization orders', () => {
const betaCode1 = '*o(/rkos *a)/zwton *e(/llhnas *a)=pis';
const betaCode2 = '*(/orkos *)/azwton *(/ellhnas *)=apis';
const greek = 'Ὅρκος Ἄζωτον Ἕλληνας Ἆπις';
const betaCode1 = '*o(/rkos *a)/zwton *e(/llhnas *a)=pis *w(=|';
const betaCode2 = '*(/orkos *)/azwton *(/ellhnas *)=apis *(=|w';
const betaCode3 = '*(/orkos *)/azwton *(/ellhnas *)=apis *(=w|';
const greek = 'Ὅρκος Ἄζωτον Ἕλληνας Ἆπις ᾯ';

expect(bc.betaCodeToGreek(betaCode1)).to.equal(greek);
expect(bc.betaCodeToGreek(betaCode2)).to.equal(greek);
expect(bc.betaCodeToGreek(betaCode3)).to.equal(greek);
});

it('should be able to use a custom map', () => {
Expand Down

0 comments on commit a64a349

Please sign in to comment.