about summary refs log tree commit diff
path: root/src/liballoc/tests/string.rs
diff options
context:
space:
mode:
authorXAMPPRocky <4464295+XAMPPRocky@users.noreply.github.com>2020-02-26 21:39:30 +0100
committerGitHub <noreply@github.com>2020-02-26 21:39:30 +0100
commit526280a853f31bbc3120334dfe46e19ea4dbaa25 (patch)
treecd35561be4cdcd7591d98bae715726c0e40995b7 /src/liballoc/tests/string.rs
parente7a344fb745a0a663e21be947b2619df05df6d31 (diff)
parentabc3073c92df034636a823c5382ece2186d22b9e (diff)
downloadrust-526280a853f31bbc3120334dfe46e19ea4dbaa25.tar.gz
rust-526280a853f31bbc3120334dfe46e19ea4dbaa25.zip
Merge branch 'master' into relnotes-1.42.0
Diffstat (limited to 'src/liballoc/tests/string.rs')
-rw-r--r--src/liballoc/tests/string.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/liballoc/tests/string.rs b/src/liballoc/tests/string.rs
index dd444958459..08859b2b24b 100644
--- a/src/liballoc/tests/string.rs
+++ b/src/liballoc/tests/string.rs
@@ -50,7 +50,11 @@ fn test_from_utf8() {
 
     let xs = b"hello\xFF".to_vec();
     let err = String::from_utf8(xs).unwrap_err();
+    assert_eq!(err.as_bytes(), b"hello\xff");
+    let err_clone = err.clone();
+    assert_eq!(err, err_clone);
     assert_eq!(err.into_bytes(), b"hello\xff".to_vec());
+    assert_eq!(err_clone.utf8_error().valid_up_to(), 5);
 }
 
 #[test]