diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2019-07-27 02:07:23 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2019-07-27 18:56:17 +0300 |
| commit | 5486cc69bdcc1c0027d7d06cd7630a2c48e3b063 (patch) | |
| tree | cc51bb82d6b0e4456f49f008f551c87573eeec53 /src/test/ui/concat-rpass.rs | |
| parent | 9be35f82c1abf2ecbab489bca9eca138ea648312 (diff) | |
| download | rust-5486cc69bdcc1c0027d7d06cd7630a2c48e3b063.tar.gz rust-5486cc69bdcc1c0027d7d06cd7630a2c48e3b063.zip | |
tests: Move run-pass tests with naming conflicts to ui
Diffstat (limited to 'src/test/ui/concat-rpass.rs')
| -rw-r--r-- | src/test/ui/concat-rpass.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/test/ui/concat-rpass.rs b/src/test/ui/concat-rpass.rs new file mode 100644 index 00000000000..0c30a39d6a2 --- /dev/null +++ b/src/test/ui/concat-rpass.rs @@ -0,0 +1,18 @@ +// run-pass + +pub fn main() { + assert_eq!(format!(concat!("foo", "bar", "{}"), "baz"), "foobarbaz".to_string()); + assert_eq!(format!(concat!()), "".to_string()); + // check trailing comma is allowed in concat + assert_eq!(concat!("qux", "quux",).to_string(), "quxquux".to_string()); + + assert_eq!( + concat!(1, 2, 3, 4f32, 4.0, 'a', true), + "12344.0atrue" + ); + + assert!(match "12344.0atrue" { + concat!(1, 2, 3, 4f32, 4.0, 'a', true) => true, + _ => false + }) +} |
