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