Commit 561b58ab authored by sunguoshu's avatar sunguoshu

补充测试案例

parent 5909658f
......@@ -77,6 +77,63 @@ describe('测试整数', () => {
it('1111 toBe 壹仟壹佰壹拾壹元整', () => {
expect(numberToWords(1111)).toBe('壹仟壹佰壹拾壹元整')
})
it('10000 toBe 壹万元整', () => {
expect(numberToWords(10000)).toBe('壹万元整')
})
it('10001 toBe 壹万零壹元整', () => {
expect(numberToWords(10001)).toBe('壹万零壹元整')
})
it('12345 toBe 壹万贰仟叁佰肆拾伍元整', () => {
expect(numberToWords(12345)).toBe('壹万贰仟叁佰肆拾伍元整')
})
it('100000 toBe 壹拾万元整', () => {
expect(numberToWords(100000)).toBe('壹拾万元整')
})
it('110000 toBe 壹拾壹万元整', () => {
expect(numberToWords(110000)).toBe('壹拾壹万元整')
})
it('1000001 toBe 壹佰万零壹元整', () => {
expect(numberToWords(1000001)).toBe('壹佰万零壹元整')
})
it('1100000 toBe 壹佰壹拾万元整', () => {
expect(numberToWords(1100000)).toBe('壹佰壹拾万元整')
})
it('1010000 toBe 壹佰零壹万元整', () => {
expect(numberToWords(1010000)).toBe('壹佰零壹万元整')
})
it('10000000 toBe 壹仟万元整', () => {
expect(numberToWords(10000000)).toBe('壹仟万元整')
})
it('10000001 toBe 壹仟万零壹元整', () => {
expect(numberToWords(10000001)).toBe('壹仟万零壹元整')
})
it('10010000 toBe 壹仟零壹万元整', () => {
expect(numberToWords(10010000)).toBe('壹仟零壹万元整')
})
it('10100000 toBe 壹仟零壹拾万元整', () => {
expect(numberToWords(10100000)).toBe('壹仟零壹拾万元整')
})
it('11000000 toBe 壹仟壹佰万元整', () => {
expect(numberToWords(11000000)).toBe('壹仟壹佰万元整')
})
it('100000000 toBe 壹亿元整', () => {
expect(numberToWords(100000000)).toBe('壹亿元整')
})
it('1000000000 toBe 壹拾亿元整', () => {
expect(numberToWords(1000000000)).toBe('壹拾亿元整')
})
it('10000000000 toBe 壹佰亿元整', () => {
expect(numberToWords(10000000000)).toBe('壹佰亿元整')
})
it('99999999999 toBe 玖佰玖拾玖亿玖仟玖佰玖拾玖万玖仟玖佰玖拾玖元整', () => {
expect(numberToWords(99999999999)).toBe('玖佰玖拾玖亿玖仟玖佰玖拾玖万玖仟玖佰玖拾玖元整')
})
it('90909090990 toBe玖佰零玖亿零玖佰零玖万零玖佰玖拾元整', () => {
expect(numberToWords(90909090990)).toBe('玖佰零玖亿零玖佰零玖万零玖佰玖拾元整')
})
it('100000000000 toBe 壹仟亿元整', () => {
expect(numberToWords(100000000000)).toBe('壹仟亿元整')
})
it('100010000.00 toBe 壹亿零壹万元', () => {
expect(numberToWords(100010000.0)).toBe('壹亿零壹万元整')
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment