Commit dad5d355 authored by sunguoshu's avatar sunguoshu

增加四位数内整数测试

parent ef62254f
Pipeline #312 canceled with stages
......@@ -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('壹仟壹佰壹拾壹元整')
})
})
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