Use method syntax in tests.

This commit is contained in:
Simon Sapin
2015-04-21 09:45:36 +02:00
parent f2eb73d85f
commit 1acccecfeb
3 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -14,7 +14,7 @@ fn main() {
assert_eq!(compose('A','\u{30a}'), Some('Å'));
let s = "ÅΩ";
let c = UnicodeNormalization::nfc(s).collect::<String>();
let c = s.nfc().collect::<String>();
assert_eq!(c, "ÅΩ");
}
```
+1 -1
View File
@@ -22,7 +22,7 @@
//! assert_eq!(compose('A','\u{30a}'), Some('Å'));
//!
//! let s = "ÅΩ";
//! let c = UnicodeNormalization::nfc(s).collect::<String>();
//! let c = s.nfc().collect::<String>();
//! assert_eq!(c, "ÅΩ");
//! }
//! ```
+5 -5
View File
@@ -14,7 +14,7 @@ use super::str::UnicodeNormalization;
fn test_nfd() {
macro_rules! t {
($input: expr, $expected: expr) => {
assert_eq!(UnicodeNormalization::nfd($input).collect::<String>(), $expected);
assert_eq!($input.nfd().collect::<String>(), $expected);
}
}
t!("abc", "abc");
@@ -33,7 +33,7 @@ fn test_nfd() {
fn test_nfkd() {
macro_rules! t {
($input: expr, $expected: expr) => {
assert_eq!(UnicodeNormalization::nfkd($input).collect::<String>(), $expected);
assert_eq!($input.nfkd().collect::<String>(), $expected);
}
}
t!("abc", "abc");
@@ -52,7 +52,7 @@ fn test_nfkd() {
fn test_nfc() {
macro_rules! t {
($input: expr, $expected: expr) => {
assert_eq!(UnicodeNormalization::nfc($input).collect::<String>(), $expected);
assert_eq!($input.nfc().collect::<String>(), $expected);
}
}
t!("abc", "abc");
@@ -72,7 +72,7 @@ fn test_nfc() {
fn test_nfkc() {
macro_rules! t {
($input: expr, $expected: expr) => {
assert_eq!(UnicodeNormalization::nfkc($input).collect::<String>(), $expected);
assert_eq!($input.nfkc().collect::<String>(), $expected);
}
}
t!("abc", "abc");
@@ -92,7 +92,7 @@ fn test_nfkc() {
fn test_official() {
use testdata::TEST_NORM;
macro_rules! normString {
($fun: ident, $input: expr) => { UnicodeNormalization::$fun($input).collect::<String>() }
($method: ident, $input: expr) => { $input.$method().collect::<String>() }
}
for &(s1, s2, s3, s4, s5) in TEST_NORM {