Skip to content

Commit dec9411

Browse files
committed
---
yaml --- r: 228341 b: refs/heads/try c: 304f545 h: refs/heads/master i: 228339: 26d9ac6 v: v3
1 parent 5f5fef8 commit dec9411

File tree

2 files changed

+46
-1
lines changed

2 files changed

+46
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: aca2057ed5fb7af3f8905b2bc01f72fa001c35c8
33
refs/heads/snap-stage3: 1af31d4974e33027a68126fa5a5a3c2c6491824f
4-
refs/heads/try: 2d34a531f4ef53f19b8cd512c121dd868328b649
4+
refs/heads/try: 304f5452749b139f518baf6fa6160b66af654223
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
77
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try/src/libstd/ascii.rs

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,51 @@ mod tests {
537537
}
538538
}
539539

540+
#[test]
541+
fn test_make_ascii_lower_case() {
542+
macro_rules! test {
543+
($from: expr, $to: expr) => {
544+
{
545+
let mut x = $from;
546+
x.make_ascii_lowercase();
547+
assert_eq!(x, $to);
548+
}
549+
}
550+
}
551+
test!(b'A', b'a');
552+
test!(b'a', b'a');
553+
test!(b'!', b'!');
554+
test!('A', 'a');
555+
test!('À', 'À');
556+
test!('a', 'a');
557+
test!('!', '!');
558+
test!(b"H\xc3\x89".to_vec(), b"h\xc3\x89");
559+
test!("HİKß".to_string(), "hİKß");
560+
}
561+
562+
563+
#[test]
564+
fn test_make_ascii_upper_case() {
565+
macro_rules! test {
566+
($from: expr, $to: expr) => {
567+
{
568+
let mut x = $from;
569+
x.make_ascii_uppercase();
570+
assert_eq!(x, $to);
571+
}
572+
}
573+
}
574+
test!(b'a', b'A');
575+
test!(b'A', b'A');
576+
test!(b'!', b'!');
577+
test!('a', 'A');
578+
test!('à', 'à');
579+
test!('A', 'A');
580+
test!('!', '!');
581+
test!(b"h\xc3\xa9".to_vec(), b"H\xc3\xa9");
582+
test!("hıKß".to_string(), "HıKß");
583+
}
584+
540585
#[test]
541586
fn test_eq_ignore_ascii_case() {
542587
assert!("url()URL()uRl()Ürl".eq_ignore_ascii_case("url()url()url()Ürl"));

0 commit comments

Comments
 (0)