Skip to content

Commit

Permalink
script for update file LineBreakTest.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
liborm85 committed Dec 18, 2024
1 parent ce9cdc6 commit a82a86f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
5 changes: 3 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ An implementation of the Unicode Line Breaking Algorithm (UAX #14)
This is a JavaScript implementation of the [Unicode Line Breaking Algorithm](http://www.unicode.org/reports/tr14/#SampleCode) for Node.js
(and browsers I guess). Currently supports Unicode version 13. It is used by [PDFKit](http://github.com/devongovett/pdfkit/) for
line wrapping text in PDF documents, but since the algorithm knows nothing about the actual visual appearance or layout of text,
line wrapping text in PDF documents, but since the algorithm knows nothing about the actual visual appearance or layout of text,
it could be used for other things as well.

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

## License

Expand Down
11 changes: 11 additions & 0 deletions test/update_test_file.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import fs from 'fs';
import https from'https';

const file = fs.createWriteStream('LineBreakTest.txt');
https.get("https://www.unicode.org/Public/15.0.0/ucd/auxiliary/LineBreakTest.txt", function(response) {
response.pipe(file);
file.on("finish", () => {
file.close();
console.log("Test file updated.");
});
});

0 comments on commit a82a86f

Please sign in to comment.