Skip to content

Commit 87e487f

Browse files
committed
---
yaml --- r: 228342 b: refs/heads/try c: 90d61d8 h: refs/heads/master v: v3
1 parent dec9411 commit 87e487f

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
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: 304f5452749b139f518baf6fa6160b66af654223
4+
refs/heads/try: 90d61d828f82a830b9edc202dd28bb5b4defc7e9
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: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -469,16 +469,19 @@ mod tests {
469469
use char::from_u32;
470470

471471
#[test]
472-
fn test_ascii() {
473-
assert!("banana".chars().all(|c| c.is_ascii()));
474-
assert!(!"ประเทศไทย中华Việt Nam".chars().all(|c| c.is_ascii()));
475-
}
472+
fn test_is_ascii() {
473+
assert!(b"".is_ascii());
474+
assert!(b"banana\0\x7F".is_ascii());
475+
assert!(b"banana\0\x7F".iter().all(|b| b.is_ascii()));
476+
assert!(!b"Vi\xe1\xbb\x87t Nam".is_ascii());
477+
assert!(!b"Vi\xe1\xbb\x87t Nam".iter().all(|b| b.is_ascii()));
478+
assert!(!b"\xe1\xbb\x87".iter().any(|b| b.is_ascii()));
476479

477-
#[test]
478-
fn test_ascii_vec() {
479480
assert!("".is_ascii());
480-
assert!("a".is_ascii());
481-
assert!(!"\u{2009}".is_ascii());
481+
assert!("banana\0\u{7F}".is_ascii());
482+
assert!("banana\0\u{7F}".chars().all(|c| c.is_ascii()));
483+
assert!(!"ประเทศไทย中华Việt Nam".chars().all(|c| c.is_ascii()));
484+
assert!(!"ประเทศไทย中华ệ ".chars().any(|c| c.is_ascii()));
482485
}
483486

484487
#[test]

0 commit comments

Comments
 (0)