language changes: ~"str" -> "str".to_owned().

This commit is contained in:
Kang Seonghoon 2014-05-16 17:04:21 +09:00
parent f8a05676b7
commit ddab09459b
3 changed files with 20 additions and 17 deletions

View File

@ -701,10 +701,10 @@ mod tests {
#[test]
fn test_date_fmt() {
assert_eq!(DateZ::from_ymd(2012, 3, 4).unwrap().to_str(), ~"2012-03-04");
assert_eq!(DateZ::from_ymd(0, 3, 4).unwrap().to_str(), ~"0000-03-04");
assert_eq!(DateZ::from_ymd(-307, 3, 4).unwrap().to_str(), ~"-0307-03-04");
assert_eq!(DateZ::from_ymd(12345, 3, 4).unwrap().to_str(), ~"+12345-03-04");
assert_eq!(DateZ::from_ymd(2012, 3, 4).unwrap().to_str(), "2012-03-04".to_owned());
assert_eq!(DateZ::from_ymd(0, 3, 4).unwrap().to_str(), "0000-03-04".to_owned());
assert_eq!(DateZ::from_ymd(-307, 3, 4).unwrap().to_str(), "-0307-03-04".to_owned());
assert_eq!(DateZ::from_ymd(12345, 3, 4).unwrap().to_str(), "+12345-03-04".to_owned());
}
}

View File

@ -391,14 +391,15 @@ mod tests {
#[test]
fn test_duration_fmt() {
assert_eq!(Duration::zero().to_str(), ~"PT0S");
assert_eq!(Duration::days(42).to_str(), ~"P42D");
assert_eq!(Duration::days(-42).to_str(), ~"P-42D");
assert_eq!(Duration::seconds(42).to_str(), ~"PT42S");
assert_eq!(Duration::milliseconds(42).to_str(), ~"PT0,042S");
assert_eq!(Duration::microseconds(42).to_str(), ~"PT0,000042S");
assert_eq!(Duration::nanoseconds(42).to_str(), ~"PT0,000000042S");
assert_eq!((Duration::days(7) + Duration::milliseconds(6543)).to_str(), ~"P7DT6,543S");
assert_eq!(Duration::zero().to_str(), "PT0S".to_owned());
assert_eq!(Duration::days(42).to_str(), "P42D".to_owned());
assert_eq!(Duration::days(-42).to_str(), "P-42D".to_owned());
assert_eq!(Duration::seconds(42).to_str(), "PT42S".to_owned());
assert_eq!(Duration::milliseconds(42).to_str(), "PT0,042S".to_owned());
assert_eq!(Duration::microseconds(42).to_str(), "PT0,000042S".to_owned());
assert_eq!(Duration::nanoseconds(42).to_str(), "PT0,000000042S".to_owned());
assert_eq!((Duration::days(7) + Duration::milliseconds(6543)).to_str(),
"P7DT6,543S".to_owned());
}
}

View File

@ -258,11 +258,13 @@ mod tests {
#[test]
fn test_time_fmt() {
assert_eq!(hmsm(23, 59, 59, 999).to_str(), ~"23:59:59,999");
assert_eq!(hmsm(23, 59, 59, 1_000).to_str(), ~"23:59:60");
assert_eq!(hmsm(23, 59, 59, 1_001).to_str(), ~"23:59:60,001");
assert_eq!(TimeZ::from_hms_micro(0, 0, 0, 43210).unwrap().to_str(), ~"00:00:00,043210");
assert_eq!(TimeZ::from_hms_nano(0, 0, 0, 6543210).unwrap().to_str(), ~"00:00:00,006543210");
assert_eq!(hmsm(23, 59, 59, 999).to_str(), "23:59:59,999".to_owned());
assert_eq!(hmsm(23, 59, 59, 1_000).to_str(), "23:59:60".to_owned());
assert_eq!(hmsm(23, 59, 59, 1_001).to_str(), "23:59:60,001".to_owned());
assert_eq!(TimeZ::from_hms_micro(0, 0, 0, 43210).unwrap().to_str(),
"00:00:00,043210".to_owned());
assert_eq!(TimeZ::from_hms_nano(0, 0, 0, 6543210).unwrap().to_str(),
"00:00:00,006543210".to_owned());
}
}