use chinese_currency::ChineseCurrency; #[test] fn smoke_test() { assert_eq!(12.to_chinese_currency(), "壹角贰分"); assert_eq!(10.to_chinese_currency(), "壹角"); assert_eq!(2.to_chinese_currency(), "零贰分"); assert_eq!(0.to_chinese_currency(), "零圆整"); assert_eq!(345.to_chinese_currency(), "å圆肆角ä¼åˆ†"); assert_eq!(340.to_chinese_currency(), "å圆肆角"); assert_eq!(305.to_chinese_currency(), "å圆零ä¼åˆ†"); assert_eq!(300.to_chinese_currency(), "å圆整"); assert_eq!(6789.to_chinese_currency(), "陆拾柒圆æŒè§’玖分"); assert_eq!(6780.to_chinese_currency(), "陆拾柒圆æŒè§’"); assert_eq!(6709.to_chinese_currency(), "陆拾柒圆零玖分"); assert_eq!(6089.to_chinese_currency(), "陆拾圆æŒè§’玖分"); assert_eq!(6700.to_chinese_currency(), "陆拾柒圆整"); assert_eq!(6009.to_chinese_currency(), "陆拾圆零玖分"); assert_eq!(6000.to_chinese_currency(), "陆拾圆整"); assert_eq!(12300.to_chinese_currency(), "壹佰贰拾å圆整"); assert_eq!(10300.to_chinese_currency(), "壹佰零å圆整"); assert_eq!(12000.to_chinese_currency(), "壹佰贰拾圆整"); assert_eq!(10000.to_chinese_currency(), "壹佰圆整"); assert_eq!(123400.to_chinese_currency(), "壹仟贰佰å拾肆圆整"); assert_eq!(100400.to_chinese_currency(), "壹仟零肆圆整"); assert_eq!( 1234500.to_chinese_currency(), "壹万贰仟å佰肆拾ä¼åœ†æ•´" ); assert_eq!(1004500.to_chinese_currency(), "壹万零肆拾ä¼åœ†æ•´"); assert_eq!(1200500.to_chinese_currency(), "壹万贰仟零ä¼åœ†æ•´"); assert_eq!(1030500.to_chinese_currency(), "壹万零å佰零ä¼åœ†æ•´"); assert_eq!(1000000.to_chinese_currency(), "壹万圆整"); assert_eq!( 12345600.to_chinese_currency(), "壹拾贰万å仟肆佰ä¼æ‹¾é™†åœ†æ•´" ); assert_eq!(10000000.to_chinese_currency(), "壹拾万圆整"); assert_eq!( 123456700.to_chinese_currency(), "壹佰贰拾å万肆仟ä¼ä½°é™†æ‹¾æŸ’圆整" ); assert_eq!(100000000.to_chinese_currency(), "壹佰万圆整"); assert_eq!( 1234567800.to_chinese_currency(), "壹仟贰佰å拾肆万ä¼ä»Ÿé™†ä½°æŸ’拾æŒåœ†æ•´" ); assert_eq!(1000000000.to_chinese_currency(), "壹仟万圆整"); assert_eq!( 12345678900usize.to_chinese_currency(), "壹亿贰仟å佰肆拾ä¼ä¸‡é™†ä»ŸæŸ’ä½°æŒæ‹¾çŽ–圆整" ); assert_eq!(10000000000usize.to_chinese_currency(), "壹亿圆整"); assert_eq!( 123456789100usize.to_chinese_currency(), "壹拾贰亿å仟肆佰ä¼æ‹¾é™†ä¸‡æŸ’仟æŒä½°çŽ–拾壹圆整" ); assert_eq!(100000000000usize.to_chinese_currency(), "壹拾亿圆整"); assert_eq!( 1234567891200usize.to_chinese_currency(), "壹佰贰拾å亿肆仟ä¼ä½°é™†æ‹¾æŸ’万æŒä»ŸçŽ–佰壹拾贰圆整" ); assert_eq!(1000000000000usize.to_chinese_currency(), "壹佰亿圆整"); assert_eq!( 12345678912300usize.to_chinese_currency(), "壹仟贰佰å拾肆亿ä¼ä»Ÿé™†ä½°æŸ’拾æŒä¸‡çŽ–仟壹佰贰拾å圆整" ); assert_eq!(10000000000000usize.to_chinese_currency(), "壹仟亿圆整"); assert_eq!( 123456789123400usize.to_chinese_currency(), "壹万亿贰仟å佰肆拾ä¼äº¿é™†ä»ŸæŸ’ä½°æŒæ‹¾çŽ–万壹仟贰佰å拾肆圆整" ); assert_eq!( 100000000000000usize.to_chinese_currency(), "壹万亿圆整" ); assert_eq!( 1234567891234500usize.to_chinese_currency(), "壹拾贰万亿å仟肆佰ä¼æ‹¾é™†äº¿æŸ’仟æŒä½°çŽ–拾壹万贰仟å佰肆拾ä¼åœ†æ•´" ); assert_eq!( 1000000000000000usize.to_chinese_currency(), "壹拾万亿圆整" ); assert_eq!( 12345678912345600usize.to_chinese_currency(), "壹佰贰拾å万亿肆仟ä¼ä½°é™†æ‹¾æŸ’亿æŒä»ŸçŽ–佰壹拾贰万å仟肆佰ä¼æ‹¾é™†åœ†æ•´" ); assert_eq!( 10000000000000000usize.to_chinese_currency(), "壹佰万亿圆整" ); assert_eq!( 123456789123456700usize.to_chinese_currency(), "壹仟贰佰å拾肆万亿ä¼ä»Ÿé™†ä½°æŸ’拾æŒäº¿çŽ–仟壹佰贰拾å万肆仟ä¼ä½°é™†æ‹¾æŸ’圆整" ); assert_eq!( 100000000000000000usize.to_chinese_currency(), "壹仟万亿圆整" ); assert_eq!( 1234567891234567800usize.to_chinese_currency(), "壹亿亿贰仟å佰肆拾ä¼ä¸‡äº¿é™†ä»ŸæŸ’ä½°æŒæ‹¾çŽ–亿壹仟贰佰å拾肆万ä¼ä»Ÿé™†ä½°æŸ’拾æŒåœ†æ•´" ); assert_eq!( 1000000000000000000usize.to_chinese_currency(), "壹亿亿圆整" ); assert_eq!( 12345678912345678900usize.to_chinese_currency(), "壹拾贰亿亿å仟肆佰ä¼æ‹¾é™†ä¸‡äº¿æŸ’仟æŒä½°çŽ–拾壹亿贰仟å佰肆拾ä¼ä¸‡é™†ä»ŸæŸ’ä½°æŒæ‹¾çŽ–圆整" ); assert_eq!( 10000000000000000000usize.to_chinese_currency(), "壹拾亿亿圆整" ); assert_eq!( 10000000910000000900usize.to_chinese_currency(), "壹拾亿亿零玖拾壹亿零玖圆整" ); }