File tree Expand file tree Collapse file tree 3 files changed +76
-1
lines changed Expand file tree Collapse file tree 3 files changed +76
-1
lines changed Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ impl<'a> VersionChunkIter<'a> {
6565 break ;
6666 }
6767
68- if !c. is_numeric ( ) {
68+ if !c. is_ascii_digit ( ) {
6969 continue ;
7070 }
7171
@@ -283,6 +283,10 @@ mod test {
283283 source: "009"
284284 } )
285285 ) ;
286+
287+ // '๙' = U+0E59 THAI DIGIT NINE, General Category Nd
288+ let mut iter = VersionChunkIter :: new ( "x๙v" ) ;
289+ assert_eq ! ( iter. next( ) , Some ( VersionChunk :: Str ( "x๙v" ) ) ) ;
286290 }
287291
288292 #[ test]
@@ -297,6 +301,11 @@ mod test {
297301 input. sort_by ( |a, b| version_sort ( a, b) ) ;
298302 assert_eq ! ( input, expected) ;
299303
304+ let mut input = vec ! [ "x๙x" , "xéx" , "x0x" ] ;
305+ let expected = vec ! [ "x0x" , "xéx" , "x๙x" ] ;
306+ input. sort_by ( |a, b| version_sort ( a, b) ) ;
307+ assert_eq ! ( input, expected) ;
308+
300309 let mut input = vec ! [ "applesauce" , "apple" ] ;
301310 let expected = vec ! [ "apple" , "applesauce" ] ;
302311 input. sort_by ( |a, b| version_sort ( a, b) ) ;
Original file line number Diff line number Diff line change 1+ use std:: cmp:: Ordering ;
2+ use print๙msg:: print as first_print;
3+ use print0msg:: print as second_print;
4+ use printémsg:: print as third_print;
5+
6+ fn main ( ) {
7+ first_print ( ) ;
8+ second_print ( ) ;
9+ third_print ( ) ;
10+
11+ assert_eq ! ( "print๙msg" . cmp( "printémsg" ) , Ordering :: Greater ) ;
12+ }
13+
14+ /// '๙' = 0E59;THAI DIGIT NINE;Nd;
15+ mod print๙msg {
16+ pub fn print ( ) {
17+ println ! ( "Non-ASCII Decimal_Number" )
18+ }
19+ }
20+
21+ /// '0' = 0030;DIGIT ZERO;Nd;
22+ mod print0msg {
23+ pub fn print ( ) {
24+ println ! ( "ASCII Decimal_Number" )
25+ }
26+ }
27+
28+ /// 'é' = 00E9;LATIN SMALL LETTER E WITH ACUTE;Ll;
29+ mod printémsg {
30+ pub fn print ( ) {
31+ println ! ( "Lowercase_Letter" )
32+ }
33+ }
Original file line number Diff line number Diff line change 1+ use print0msg:: print as second_print;
2+ use printémsg:: print as third_print;
3+ use print๙msg:: print as first_print;
4+ use std:: cmp:: Ordering ;
5+
6+ fn main ( ) {
7+ first_print ( ) ;
8+ second_print ( ) ;
9+ third_print ( ) ;
10+
11+ assert_eq ! ( "print๙msg" . cmp( "printémsg" ) , Ordering :: Greater ) ;
12+ }
13+
14+ /// '๙' = 0E59;THAI DIGIT NINE;Nd;
15+ mod print๙msg {
16+ pub fn print ( ) {
17+ println ! ( "Non-ASCII Decimal_Number" )
18+ }
19+ }
20+
21+ /// '0' = 0030;DIGIT ZERO;Nd;
22+ mod print0msg {
23+ pub fn print ( ) {
24+ println ! ( "ASCII Decimal_Number" )
25+ }
26+ }
27+
28+ /// 'é' = 00E9;LATIN SMALL LETTER E WITH ACUTE;Ll;
29+ mod printémsg {
30+ pub fn print ( ) {
31+ println ! ( "Lowercase_Letter" )
32+ }
33+ }
You can’t perform that action at this time.
0 commit comments