Skip to content

Commit d4c4b86

Browse files
committed
update tests for new json
1 parent 3982ec7 commit d4c4b86

File tree

2 files changed

+33
-19
lines changed

2 files changed

+33
-19
lines changed

README.md

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,18 @@
1-
Beta Code JS
2-
===================
1+
# Beta Code JS
32

4-
Overview
5-
--------
3+
## Overview
64

75
Converts Greek beta code to Greek characters and vice versa.
86

9-
Try it Out
10-
----------
7+
## Try it Out
118

12-
[https://zfletch.github.io/beta-code-converter-js/](https://zfletch.github.io/beta-code-converter-js/)
9+
[https://apps.perseids.org/beta-code/](https://apps.perseids.org/beta-code/)
1310

14-
Installation
15-
------------
11+
## Installation
1612

1713
`npm install beta-code-js`
1814

19-
Usage
20-
-----
15+
## Usage
2116

2217
```javascript
2318
import { greekToBetaCode, betaCodeToGreek } from 'beta-code-js';
@@ -42,8 +37,7 @@ bc.betaCodeToGreek('mh=nin a)/eide qea\\ *phlhi+a/dew *)axilh=os');
4237

4338
```
4439

45-
Usage in Browser
46-
----------------
40+
## Usage in Browser
4741

4842
```html
4943
<html>
@@ -61,18 +55,29 @@ Usage in Browser
6155
</html>
6256
```
6357

64-
Tests
65-
-----
58+
## Tests
6659

6760
`npm test`
6861

69-
Building for Browser
70-
--------------------
62+
## Building for Browser
7163

7264
`npm run bundle`
7365

74-
Notes
75-
-----
66+
## Updating JSON
67+
68+
```bash
69+
git subtree pull --prefix vendor/beta-code-json/ https://github.com/zfletch/beta-code-json master --squash
70+
```
71+
72+
In the case of a merge conflict:
73+
74+
```bash
75+
git checkout --theirs vendor/beta-code-json/ # if necessary
76+
git add vendor/beta-code-json
77+
git commit
78+
```
79+
80+
## Notes
7681

7782
For the mappings between beta code and Unicode, see [https://github.com/zfletch/beta-code-json](https://github.com/zfletch/beta-code-json).
7883
For an example of this package being used, see [https://github.com/zfletch/beta-code-converter-js](https://github.com/zfletch/beta-code-converter-js).

test/test.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,5 +71,14 @@ describe('#betaCodeToGreek', function() {
7171
expect(bc.betaCodeToGreek(beta_code1)).to.equal(greek);
7272
expect(bc.betaCodeToGreek(beta_code2)).to.equal(greek);
7373
});
74+
75+
it('should convert characters with different capitalization orders', function() {
76+
var beta_code1 = '*o(/rkos *a)/zwton *e(/llhnas *a)=pis';
77+
var beta_code2 = '*(/orkos *)/azwton *(/ellhnas *)=apis';
78+
var greek = 'Ὅρκος Ἄζωτον Ἕλληνας Ἆπις';
79+
80+
expect(bc.betaCodeToGreek(beta_code1)).to.equal(greek);
81+
expect(bc.betaCodeToGreek(beta_code2)).to.equal(greek);
82+
});
7483
});
7584
})();

0 commit comments

Comments
 (0)