File: issue_13_tailing_comman.rs

package info (click to toggle)
rust-vec1 1.12.1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 264 kB
  • sloc: makefile: 2
file content (19 lines) | stat: -rw-r--r-- 424 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
//! [Issue 13: vec1! macro doesn't accept trailing comma](https://github.com/rustonaut/vec1/issues/13)
//!

#[macro_use]
extern crate vec1;

#[test]
fn allow_trailing_comma_in_vec_macro() {
    let _ = vec1![1u8,];
    let _ = vec1![1u8, 2u8,];
    let _ = vec1![1u8, 2u8, 3u8,];
}

#[test]
fn allow_no_trailing_comma_in_vec_macro() {
    let _ = vec1![1u8];
    let _ = vec1![1u8, 2u8];
    let _ = vec1![1u8, 2u8, 3u8];
}