Skip to content

Commit

Permalink
Add missing positional args tests
Browse files Browse the repository at this point in the history
  • Loading branch information
parasyte committed Feb 19, 2024
1 parent 6a801e9 commit 23383d2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions onlyargs_derive/compile_tests/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ fn compile_tests() {
t.pass("compile_tests/positional_pathbuf.rs");
t.pass("compile_tests/positional_string.rs");
t.pass("compile_tests/positional_u8.rs");
t.pass("compile_tests/positional_u128.rs");
t.pass("compile_tests/positional_usize.rs");
t.compile_fail("compile_tests/conflicting_positional.rs");

t.pass("compile_tests/empty.rs");
t.pass("compile_tests/optional.rs");
Expand Down
7 changes: 7 additions & 0 deletions onlyargs_derive/compile_tests/conflicting_positional.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#[derive(Debug, onlyargs_derive::OnlyArgs)]
struct Args {
rest: Vec<String>,
more: Vec<String>,
}

fn main() {}
5 changes: 5 additions & 0 deletions onlyargs_derive/compile_tests/conflicting_positional.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
error: Positional arguments can only be specified once.
--> compile_tests/conflicting_positional.rs:4:5
|
4 | more: Vec<String>,
| ^^^^

0 comments on commit 23383d2

Please sign in to comment.