-
Notifications
You must be signed in to change notification settings - Fork 34
/
test.js
32 lines (29 loc) · 1.02 KB
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
var path = require('path');
var assert = require('assert');
var categories = [
"Cc Cf Co Cs",
"Ll Lm Lo Lt Lu",
"Mc Me Mn",
"Nd Nl No",
"Pc Pd Pe Pf Pi Po Ps",
"Sc Sk Sm So",
"Zl Zp Zs",
].join(' ').split(' ');
process.stdout.write(" install\r ");
require('child_process').exec("node install.js", {stdio:'ignore'}, function (err) {
assert.ifError(err);
process.stdout.write("\x1B[32m✓\x1B[39m install\n"); // ✓
categories.forEach(function (cat) {
assert.doesNotThrow(function () {
process.stdout.write(" unicode/category/"+cat+"\r ");
// test if we can load it
require('./category/'+cat);
// clean up
delete require.cache[path.join(__dirname, 'category', cat+".js")];
// ✓
process.stdout.write("\x1B[32m✓\x1B[39m unicode/category/"+cat+"\n");
}, function(err){if(err){console.error(err);return 1}}, "failed to load "+cat+".js");
});
console.log("done.");
process.exit(0);
});