]>
git.kianting.info Git - clo/blob - tests/index.ts
1 let assert
= require("assert");
2 let cloMain
= require("../src");
4 let a
= cloMain
.match1Char("我");
6 let example1
= a({matched
: "", remained
: "我的"});
7 assert(example1
._tag
== "Some");
8 assert(example1
.value
.matched
== "我");
9 assert(example1
.value
.remained
== "的");
11 let example2
= a({matched
: "", remained
: "妳的"});
12 assert(example2
._tag
== "None");
16 let thenDo
= cloMain
.thenDo
;
18 let compPart1
= cloMain
.match1Char("我");
19 let compPart2
= cloMain
.match1Char("的");
21 let doThenTestee1
= {_tag
: "Some",value
: {matched
: "", remained
: "我的貓"}};
22 let doTestRes1
= thenDo(thenDo(doThenTestee1
, compPart1
), compPart2
);
23 assert(doTestRes1
._tag
== "Some");
24 assert(doTestRes1
.value
.matched
== "我的");
25 assert(doTestRes1
.value
.remained
== "貓");
28 let doThenTestee2
= {_tag
: "Some",value
: {matched
: "", remained
: "我們"}};
29 let doTestRes2
= thenDo(thenDo(doThenTestee2
, compPart1
), compPart2
);
30 assert(doTestRes2
._tag
== "None");
34 let harfbuzz
= require("../src/harfbuzz.js");
35 harfbuzz
.harfbuzzTest("123.abc");
38 let pdfManipulate
= require("../src/pdfManipulate.js");
39 pdfManipulate
.pdfGenerate("123.abc");
40 console
.log("/tmp/test.pdf產出ah");