]> git.proxmox.com Git - rustc.git/blob - src/test/ui/concat-rpass.rs
New upstream version 1.49.0+dfsg1
[rustc.git] / src / test / ui / concat-rpass.rs
1 // run-pass
2
3 pub fn main() {
4 assert_eq!(format!(concat!("foo", "bar", "{}"), "baz"), "foobarbaz".to_string());
5 assert_eq!(format!(concat!()), "".to_string());
6 // check trailing comma is allowed in concat
7 assert_eq!(concat!("qux", "quux",).to_string(), "quxquux".to_string());
8
9 assert_eq!(
10 concat!(1, 2, 3, 4f32, 4.0, 'a', true),
11 "12344.0atrue"
12 );
13
14 assert!(match "12344.0atrue" {
15 concat!(1, 2, 3, 4f32, 4.0, 'a', true) => true,
16 _ => false
17 })
18 }