MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_parse_flags

Function test_parse_flags

crates/common/src/cformat.rs:954–967  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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() {

Callers

nothing calls this directly

Calls 3

allFunction · 0.85
NumberClass · 0.50
SomeClass · 0.50

Tested by

no test coverage detected