-
Notifications
You must be signed in to change notification settings - Fork 34
/
testcase.js
32 lines (24 loc) · 1.22 KB
/
testcase.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
32
var han = require('./han')
console.log('original:中文\n' + han.letter('中文'), '\n')
console.log('original:要实现 Speaker Deck 那种中文转拼音的\n' + han.letter('要实现 Speaker Deck 那种中文转拼音的', '-'), '\n')
han.letter('中aaaaa中¢∞§¶•誩aa文喳aa', function(err, result){
if(err) throw err;
console.log('original:中aaaaa中¢∞§¶•誩aa文喳aa')
console.log('callback:' + result, '\n')
})
han.letter('中EnglishWords¢∞§¶•ªº文', '-', function(err, result){
console.log('original:中EnglishWords¢∞§¶•ªº文')
console.log('callback:' + result, '\n')
})
// 空
han.letter('中文', ' ');
han.letter('中文', '');
console.log('original: My Chinese name is 小鱼(sofish)')
console.log(han.pinyin('My Chinese name is 小鱼(sofish)'))
console.log('');
console.log('original: #$%^&*中23¢∞§¶•ª52849文@#$%^&*(意思,还有英文:english')
console.log(han.pinyin('#$%^&*中23¢∞§¶•ª52849文@#$%^&*(意思,还有英文:english'))
console.log('');
console.log('what about empty string? ' + han.pinyin(''));
console.log(han.pinyin('words like 1234567890 only'))
console.log(han.pinyin('English words and ∞§¶•ª will always return itself'))