Skip to content

Commit

Permalink
add test for char into string
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiaskrgr committed Jun 18, 2020
1 parent 1d0378c commit 2cde493
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/liballoc/tests/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

0 comments on commit 2cde493

Please sign in to comment.