-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
glendc
committed
Mar 31, 2024
1 parent
ef1ee2f
commit 91bc602
Showing
8 changed files
with
65 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,6 @@ edition = "2021" | |
|
||
[dependencies] | ||
venndb = { path = ".." } | ||
|
||
[dev-dependencies] | ||
trybuild = "1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#[test] | ||
fn should_compile() { | ||
let t = trybuild::TestCases::new(); | ||
t.pass("tests/compiles/*.rs"); | ||
} | ||
|
||
#[test] | ||
fn should_not_compile() { | ||
let t = trybuild::TestCases::new(); | ||
t.compile_fail("tests/fails/*.rs"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
use venndb::VennDB; | ||
|
||
#[derive(Debug, VennDB)] | ||
struct Employee { | ||
id: u32, | ||
name: String, | ||
is_manager: bool, | ||
is_admin: bool, | ||
is_active: bool, | ||
department: Department, | ||
} | ||
|
||
#[derive(Debug)] | ||
pub enum Department { | ||
Engineering, | ||
Sales, | ||
Marketing, | ||
HR, | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
use venndb::VennDB; | ||
|
||
#[derive(VennDB)] | ||
enum MyEnum { | ||
A, | ||
B, | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
error: Only Structs with named fields are supported | ||
--> tests/fails/derive_enum.rs:4:1 | ||
| | ||
4 | / enum MyEnum { | ||
5 | | A, | ||
6 | | B, | ||
7 | | } | ||
| |_^ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
use venndb::VennDB; | ||
|
||
#[derive(VennDB)] | ||
struct MyStruct(u32); | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
error: Only Structs with named fields are supported | ||
--> tests/fails/derive_tuple_struct.rs:4:1 | ||
| | ||
4 | struct MyStruct(u32); | ||
| ^^^^^^^^^^^^^^^^^^^^^ |