Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
F
fe-utils
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sunguoshu
fe-utils
Commits
dad5d355
Commit
dad5d355
authored
Jul 17, 2023
by
sunguoshu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加四位数内整数测试
parent
ef62254f
Pipeline
#312
canceled with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
78 additions
and
0 deletions
+78
-0
numberToWords.test.ts
test/money/numberToWords.test.ts
+78
-0
No files found.
test/money/numberToWords.test.ts
View file @
dad5d355
...
...
@@ -19,3 +19,81 @@ describe('numberToWords', () => {
})
})
describe
(
'测试整数'
,
()
=>
{
it
(
'1 toBe 壹元整'
,
()
=>
{
expect
(
numberToWords
(
1
)).
toBe
(
'壹元整'
)
})
it
(
'2 toBe 贰元整'
,
()
=>
{
expect
(
numberToWords
(
2
)).
toBe
(
'贰元整'
)
})
it
(
'3 toBe 叁元整'
,
()
=>
{
expect
(
numberToWords
(
3
)).
toBe
(
'叁元整'
)
})
it
(
'4 toBe 肆元整'
,
()
=>
{
expect
(
numberToWords
(
4
)).
toBe
(
'肆元整'
)
})
it
(
'5 toBe 伍元整'
,
()
=>
{
expect
(
numberToWords
(
5
)).
toBe
(
'伍元整'
)
})
it
(
'6 toBe 陆元整'
,
()
=>
{
expect
(
numberToWords
(
6
)).
toBe
(
'陆元整'
)
})
it
(
'7 toBe 柒元整'
,
()
=>
{
expect
(
numberToWords
(
7
)).
toBe
(
'柒元整'
)
})
it
(
'8 toBe 捌元整'
,
()
=>
{
expect
(
numberToWords
(
8
)).
toBe
(
'捌元整'
)
})
it
(
'9 toBe 玖元整'
,
()
=>
{
expect
(
numberToWords
(
9
)).
toBe
(
'玖元整'
)
})
it
(
'10 toBe 壹拾元整'
,
()
=>
{
expect
(
numberToWords
(
10
)).
toBe
(
'壹拾元整'
)
})
it
(
'11 toBe 壹拾壹元整'
,
()
=>
{
expect
(
numberToWords
(
11
)).
toBe
(
'壹拾壹元整'
)
})
it
(
'20 toBe 贰拾元整'
,
()
=>
{
expect
(
numberToWords
(
20
)).
toBe
(
'贰拾元整'
)
})
it
(
'55 toBe 伍拾伍元整'
,
()
=>
{
expect
(
numberToWords
(
55
)).
toBe
(
'伍拾伍元整'
)
})
it
(
'100 toBe 壹佰元整'
,
()
=>
{
expect
(
numberToWords
(
100
)).
toBe
(
'壹佰元整'
)
})
it
(
'101 toBe 壹佰零壹元整'
,
()
=>
{
expect
(
numberToWords
(
101
)).
toBe
(
'壹佰零壹元整'
)
})
it
(
'110 toBe 壹佰壹拾元整'
,
()
=>
{
expect
(
numberToWords
(
110
)).
toBe
(
'壹佰壹拾元整'
)
})
it
(
'111 toBe 壹佰壹拾壹元整'
,
()
=>
{
expect
(
numberToWords
(
111
)).
toBe
(
'壹佰壹拾壹元整'
)
})
it
(
'1000 toBe 壹仟元整'
,
()
=>
{
expect
(
numberToWords
(
1000
)).
toBe
(
'壹仟元整'
)
})
it
(
'1001 toBe 壹仟零壹元整'
,
()
=>
{
expect
(
numberToWords
(
1001
)).
toBe
(
'壹仟零壹元整'
)
})
it
(
'1010 toBe 壹仟零壹拾元整'
,
()
=>
{
expect
(
numberToWords
(
1010
)).
toBe
(
'壹仟零壹拾元整'
)
})
it
(
'1011 toBe 壹仟零壹拾壹元整'
,
()
=>
{
expect
(
numberToWords
(
1011
)).
toBe
(
'壹仟零壹拾壹元整'
)
})
it
(
'1100 toBe 壹仟壹佰元整'
,
()
=>
{
expect
(
numberToWords
(
1100
)).
toBe
(
'壹仟壹佰元整'
)
})
it
(
'1101 toBe 壹仟壹佰零壹元整'
,
()
=>
{
expect
(
numberToWords
(
1101
)).
toBe
(
'壹仟壹佰零壹元整'
)
})
it
(
'1110 toBe 壹仟壹佰壹拾元整'
,
()
=>
{
expect
(
numberToWords
(
1110
)).
toBe
(
'壹仟壹佰壹拾元整'
)
})
it
(
'1111 toBe 壹仟壹佰壹拾壹元整'
,
()
=>
{
expect
(
numberToWords
(
1111
)).
toBe
(
'壹仟壹佰壹拾壹元整'
)
})
})
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment