]> git.lizzy.rs Git - rust.git/blobdiff - src/liballoc/tests/string.rs
Derive Clone + PartialEq + Eq for std::string::FromUtf8Error
[rust.git] / src / liballoc / tests / string.rs
index dd44495845961dad751c59bba81bb1689b892abe..08859b2b24bde0b2c715cbb569f95ef1cd0c18e1 100644 (file)
@@ -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]