@@ -30,6 +30,13 @@ describe('#greekToBetaCode', () => {
30
30
expect ( bc . greekToBetaCode ( greek ) ) . to . equal ( betaCode ) ;
31
31
} ) ;
32
32
33
+ it ( 'should convert characters with many diacritics' , ( ) => {
34
+ const greek = 'ᾧᾯ' ;
35
+ const betaCode = 'w(=|*(=w|' ;
36
+
37
+ expect ( bc . greekToBetaCode ( greek ) ) . to . equal ( betaCode ) ;
38
+ } ) ;
39
+
33
40
it ( 'should normalize the Unicode' , ( ) => {
34
41
const greek = 'Πολλὴ μὲν ἐν βροτοῖσι κοὐκ ἀνώνυμος θεὰ κέκλημαι Κύπρις οὐρανοῦ τ᾿ ἔσω·' ;
35
42
const betaCode = '*pollh\\ me\\n e)n brotoi=si kou)k a)nw/numos qea\\ ke/klhmai *ku/pris ou)ranou= t᾿ e)/sw:' ;
@@ -78,12 +85,14 @@ describe('#betaCodeToGreek', () => {
78
85
} ) ;
79
86
80
87
it ( 'should convert characters with different capitalization orders' , ( ) => {
81
- const betaCode1 = '*o(/rkos *a)/zwton *e(/llhnas *a)=pis' ;
82
- const betaCode2 = '*(/orkos *)/azwton *(/ellhnas *)=apis' ;
83
- const greek = 'Ὅρκος Ἄζωτον Ἕλληνας Ἆπις' ;
88
+ const betaCode1 = '*o(/rkos *a)/zwton *e(/llhnas *a)=pis *w(=|' ;
89
+ const betaCode2 = '*(/orkos *)/azwton *(/ellhnas *)=apis *(=|w' ;
90
+ const betaCode3 = '*(/orkos *)/azwton *(/ellhnas *)=apis *(=w|' ;
91
+ const greek = 'Ὅρκος Ἄζωτον Ἕλληνας Ἆπις ᾯ' ;
84
92
85
93
expect ( bc . betaCodeToGreek ( betaCode1 ) ) . to . equal ( greek ) ;
86
94
expect ( bc . betaCodeToGreek ( betaCode2 ) ) . to . equal ( greek ) ;
95
+ expect ( bc . betaCodeToGreek ( betaCode3 ) ) . to . equal ( greek ) ;
87
96
} ) ;
88
97
89
98
it ( 'should be able to use a custom map' , ( ) => {
0 commit comments