Skip to content

Commit 0cd5996

Browse files
committed
Add test suite
Signed-off-by: Christian Poveda <[email protected]>
1 parent f9a53a6 commit 0cd5996

File tree

5 files changed

+50
-1
lines changed

5 files changed

+50
-1
lines changed

Cargo.lock

Lines changed: 31 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cyclonedx-bom-macros/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ rust-version.workspace = true
1111
[lib]
1212
proc-macro = true
1313

14-
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
14+
[dev-dependencies]
15+
trybuild = "1.0"
1516

1617
[dependencies]
1718
proc-macro2 = "1.0.78"

cyclonedx-bom-macros/tests/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#[test]
2+
fn ui() {
3+
let t = trybuild::TestCases::new();
4+
t.pass("tests/ui/pass/*.rs");
5+
t.compile_fail("tests/ui/fail/*.rs");
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
use cyclonedx_bom_macros::versioned;
2+
3+
#[versioned("1.3")]
4+
struct Foo;
5+
6+
fn main() {}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
error: cannot parse module: expected `mod` while using the `#[versioned]` macro
2+
--> tests/ui/fail/struct.rs:4:1
3+
|
4+
4 | struct Foo;
5+
| ^^^^^^

0 commit comments

Comments
 (0)