diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2020-06-18 11:19:03 +0200 |
|---|---|---|
| committer | Matthias Krüger <matthias.krueger@famsik.de> | 2020-06-18 11:19:03 +0200 |
| commit | 2cde4932c7e8bd6000378af41029299ccf6eea69 (patch) | |
| tree | 53366ac74182551d3d16a565c93631291135ef15 /src/liballoc/tests | |
| parent | 1d0378c454de72ddcfc08bcc105744923ef2d4d4 (diff) | |
| download | rust-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.rs | 7 |
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()); +} |
