Skip to content

Commit a82a86f

Browse files
committed
script for update file LineBreakTest.txt
1 parent ce9cdc6 commit a82a86f

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

readme.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ An implementation of the Unicode Line Breaking Algorithm (UAX #14)
99
1010
This is a JavaScript implementation of the [Unicode Line Breaking Algorithm](http://www.unicode.org/reports/tr14/#SampleCode) for Node.js
1111
(and browsers I guess). Currently supports Unicode version 13. It is used by [PDFKit](http://github.com/devongovett/pdfkit/) for
12-
line wrapping text in PDF documents, but since the algorithm knows nothing about the actual visual appearance or layout of text,
12+
line wrapping text in PDF documents, but since the algorithm knows nothing about the actual visual appearance or layout of text,
1313
it could be used for other things as well.
1414

1515
## Installation
@@ -55,7 +55,8 @@ contributing or fixing bugs, these things might be of interest.
5555
`LineBreakTest.txt` from the Unicode database, which is included in the repository for performance
5656
reasons while running them. About 50 of the over 7600 tests are currently skipped due to
5757
implementation differences. It appears that some of the tests may be wrong or use different
58-
tailoring from the spec.
58+
tailoring from the spec. To update the `LineBreakTest.txt` file, use the script
59+
`test/update_test_file.js`, which downloads and updates the tests for the new Unicode version.
5960

6061
## License
6162

test/update_test_file.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import fs from 'fs';
2+
import https from'https';
3+
4+
const file = fs.createWriteStream('LineBreakTest.txt');
5+
https.get("https://www.unicode.org/Public/15.0.0/ucd/auxiliary/LineBreakTest.txt", function(response) {
6+
response.pipe(file);
7+
file.on("finish", () => {
8+
file.close();
9+
console.log("Test file updated.");
10+
});
11+
});

0 commit comments

Comments
 (0)