-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from Trantorian1/test/getEvents
✅ Added tests for `starknet_getEvents`
- Loading branch information
Showing
8 changed files
with
562 additions
and
74 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
[workspace] | ||
members = [ | ||
members = [ "macros", | ||
"macros", | ||
"unit_tests", | ||
] | ||
default-members = ["unit_tests"] | ||
resolver = "2" | ||
|
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 @@ | ||
[package] | ||
name = "macros" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[lib] | ||
proc-macro = true | ||
|
||
[dependencies] | ||
quote = "1.0.35" | ||
syn = "2.0.48" |
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 proc_macro::TokenStream; | ||
use quote::{quote, ToTokens}; | ||
use syn::{parse_macro_input, ItemFn}; | ||
|
||
#[proc_macro_attribute] | ||
pub fn logging(_: TokenStream, input: TokenStream) -> TokenStream { | ||
let mut input = parse_macro_input!(input as ItemFn); | ||
|
||
input.block.stmts.insert( | ||
0, | ||
syn::parse( | ||
quote! { | ||
env_logger::builder().is_test(true).try_init().err(); | ||
} | ||
.into(), | ||
) | ||
.unwrap(), | ||
); | ||
|
||
input.into_token_stream().into() | ||
} |
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
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 |
---|---|---|
@@ -1,5 +1,10 @@ | ||
/* Common imports used throughout all unit tests */ | ||
|
||
#[allow(unused_imports)] | ||
pub use macros::*; | ||
#[allow(unused_imports)] | ||
pub use rstest::*; | ||
#[allow(unused_imports)] | ||
pub use unit_tests::constants::*; | ||
#[allow(unused_imports)] | ||
pub use unit_tests::fixtures::*; |
Oops, something went wrong.