about summary refs log tree commit diff
path: root/src/liballoc/tests
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2020-06-18 11:19:03 +0200
committerMatthias Krüger <matthias.krueger@famsik.de>2020-06-18 11:19:03 +0200
commit2cde4932c7e8bd6000378af41029299ccf6eea69 (patch)
tree53366ac74182551d3d16a565c93631291135ef15 /src/liballoc/tests
parent1d0378c454de72ddcfc08bcc105744923ef2d4d4 (diff)
downloadrust-2cde4932c7e8bd6000378af41029299ccf6eea69.tar.gz
rust-2cde4932c7e8bd6000378af41029299ccf6eea69.zip
add test for char into string
Diffstat (limited to 'src/liballoc/tests')
-rw-r--r--src/liballoc/tests/string.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/liballoc/tests/string.rs b/src/liballoc/tests/string.rs
index 9ea020d2d19..d38655af78c 100644
--- a/src/liballoc/tests/string.rs
+++ b/src/liballoc/tests/string.rs
@@ -714,3 +714,10 @@ fn test_try_reserve_exact() {
         }
     }
 }
+
+#[test]
+fn test_from_char() {
+    assert_eq!(String::from('a'), 'a'.to_string());
+    let s: String = 'x'.into();
+    assert_eq!(s, 'x'.to_string());
+}