File tree Expand file tree Collapse file tree 6 files changed +40
-79
lines changed Expand file tree Collapse file tree 6 files changed +40
-79
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: 900bc1298df011bfb094858b11cdfd8d6b01418c
2
+ refs/heads/master: eb0cdc02e3b443fe119cb4957856a63dbd5923d4
Original file line number Diff line number Diff line change @@ -41,6 +41,26 @@ import is_alphabetic = unicode::derived_property::Alphabetic;
41
41
import is_XID_start = unicode:: derived_property:: XID_Start ;
42
42
import is_XID_continue = unicode:: derived_property:: XID_Continue ;
43
43
44
+ /*
45
+ Function: is_lowercase
46
+
47
+ Indicates whether a character is in lower case, defined in terms of the
48
+ Unicode General Category 'Ll'.
49
+ */
50
+ pure fn is_lowercase ( c : char ) -> bool {
51
+ ret unicode:: general_category:: Ll ( c) ;
52
+ }
53
+
54
+ /*
55
+ Function: is_uppercase
56
+
57
+ Indicates whether a character is in upper case, defined in terms of the
58
+ Unicode General Category 'Lu'.
59
+ */
60
+ pure fn is_uppercase ( c : char ) -> bool {
61
+ ret unicode:: general_category:: Lu ( c) ;
62
+ }
63
+
44
64
/*
45
65
Function: is_whitespace
46
66
@@ -126,4 +146,4 @@ pure fn cmp(a: char, b: char) -> int {
126
146
ret if b > a { -1 }
127
147
else if b < a { 1 }
128
148
else { 0 }
129
- }
149
+ }
Original file line number Diff line number Diff line change @@ -152,12 +152,6 @@ mod icu {
152
152
#[ abi = "cdecl" ]
153
153
native mod libicu {
154
154
pure fn u_hasBinaryProperty ( c : UChar32 , which : UProperty ) -> UBool ;
155
- pure fn u_isdigit ( c : UChar32 ) -> UBool ;
156
- pure fn u_islower ( c : UChar32 ) -> UBool ;
157
- pure fn u_isspace ( c : UChar32 ) -> UBool ;
158
- pure fn u_isupper ( c : UChar32 ) -> UBool ;
159
- pure fn u_tolower ( c : UChar32 ) -> UChar32 ;
160
- pure fn u_toupper ( c : UChar32 ) -> UChar32 ;
161
155
}
162
156
}
163
157
@@ -170,40 +164,3 @@ pure fn is_XID_continue(c: char) -> bool {
170
164
ret icu:: libicu:: u_hasBinaryProperty ( c, icu:: UCHAR_XID_START )
171
165
== icu:: TRUE ;
172
166
}
173
-
174
- /*
175
- Function: is_digit
176
-
177
- Returns true if a character is a digit.
178
- */
179
- pure fn is_digit ( c : char ) -> bool {
180
- ret icu:: libicu:: u_isdigit ( c) == icu:: TRUE ;
181
- }
182
-
183
- /*
184
- Function: is_lower
185
-
186
- Returns true if a character is a lowercase letter.
187
- */
188
- pure fn is_lower ( c : char ) -> bool {
189
- ret icu:: libicu:: u_islower ( c) == icu:: TRUE ;
190
- }
191
-
192
- /*
193
- Function: is_space
194
-
195
- Returns true if a character is space.
196
- */
197
- pure fn is_space ( c : char ) -> bool {
198
- ret icu:: libicu:: u_isspace ( c) == icu:: TRUE ;
199
- }
200
-
201
- /*
202
- Function: is_upper
203
-
204
- Returns true if a character is an uppercase letter.
205
- */
206
- pure fn is_upper ( c : char ) -> bool {
207
- ret icu:: libicu:: u_isupper ( c) == icu:: TRUE ;
208
- }
209
-
Original file line number Diff line number Diff line change @@ -3,6 +3,24 @@ import core::*;
3
3
use std;
4
4
import char;
5
5
6
+ #[ test]
7
+ fn test_is_lowercase ( ) {
8
+ assert char:: is_lowercase ( 'a' ) ;
9
+ assert char:: is_lowercase ( 'ö' ) ;
10
+ assert char:: is_lowercase ( 'ß' ) ;
11
+ assert !char:: is_lowercase ( 'Ü' ) ;
12
+ assert !char:: is_lowercase ( 'P' ) ;
13
+ }
14
+
15
+ #[ test]
16
+ fn test_is_uppercase ( ) {
17
+ assert !char:: is_uppercase ( 'h' ) ;
18
+ assert !char:: is_uppercase ( 'ä' ) ;
19
+ assert !char:: is_uppercase ( 'ß' ) ;
20
+ assert char:: is_uppercase ( 'Ö' ) ;
21
+ assert char:: is_uppercase ( 'T' ) ;
22
+ }
23
+
6
24
#[ test]
7
25
fn test_is_whitespace ( ) {
8
26
assert char:: is_whitespace ( ' ' ) ;
Original file line number Diff line number Diff line change @@ -39,10 +39,6 @@ mod test;
39
39
mod tri;
40
40
mod treemap;
41
41
mod uint;
42
-
43
- #[cfg(unicode)]
44
- mod unicode;
45
-
46
42
mod unsafe;
47
43
mod uv;
48
44
mod vec;
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments