File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2726,4 +2726,24 @@ mod tests {
27262726 assert_eq ! ( "TypeError" , & * translated. unwrap_err( ) . class( ) . name( ) , ) ;
27272727 } )
27282728 }
2729+
2730+ #[ test]
2731+ fn str_isprintable_unicode15 ( ) {
2732+ // Regression test for https://github.com/RustPython/RustPython/issues/7525
2733+ // At the time of the issue, RustPython used unic_ucd_category which had
2734+ // outdated Unicode data, causing U+0B55 to be misclassified as Unassigned.
2735+ // Now fixed by migrating to icu_properties with up-to-date Unicode data.
2736+
2737+ // Characters that should be printable
2738+ assert ! ( PyStr :: from( "\u{0B55} " ) . isprintable( ) ) ;
2739+ assert ! ( PyStr :: from( "A" ) . isprintable( ) ) ;
2740+ assert ! ( PyStr :: from( " " ) . isprintable( ) ) ;
2741+ assert ! ( PyStr :: from( "" ) . isprintable( ) ) ;
2742+
2743+ // Characters that should NOT be printable
2744+ assert ! ( !PyStr :: from( "\x00 " ) . isprintable( ) ) ;
2745+ assert ! ( !PyStr :: from( "\u{200B} " ) . isprintable( ) ) ;
2746+ assert ! ( !PyStr :: from( "\u{E000} " ) . isprintable( ) ) ;
2747+ assert ! ( !PyStr :: from( "\u{00A0} " ) . isprintable( ) ) ;
2748+ }
27292749}
You can’t perform that action at this time.
0 commit comments