()
| 952 | |
| 953 | #[test] |
| 954 | fn test_parse_flags() { |
| 955 | let expected = Ok(CFormatSpec { |
| 956 | format_type: CFormatType::Number(CNumberType::DecimalD), |
| 957 | min_field_width: Some(CFormatQuantity::Amount(10)), |
| 958 | precision: None, |
| 959 | flags: CConversionFlags::all(), |
| 960 | }); |
| 961 | let parsed = "% 0 -+++###10d".parse::<CFormatSpec>(); |
| 962 | assert_eq!(parsed, expected); |
| 963 | assert_eq!( |
| 964 | parsed.unwrap().format_number(&BigInt::from(12)), |
| 965 | "+12 ".to_owned() |
| 966 | ); |
| 967 | } |
| 968 | |
| 969 | #[test] |
| 970 | fn test_parse_and_format_string() { |