Skip to content

Commit

Permalink
Separate parsing utils into new test-case-utils crate (#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
evforde committed Feb 10, 2023
1 parent 5755171 commit 70a962f
Show file tree
Hide file tree
Showing 11 changed files with 43 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ doctest = false
path = "src/lib.rs"

[dependencies]
test-case-macros = { version = "2.2.1", path = "crates/test-case-macros", default-features = false }
test-case-macros = { version = "2.2.2", path = "crates/test-case-macros", default-features = false }
regex = { version = "1.5", optional = true }

[dev-dependencies]
Expand Down
29 changes: 29 additions & 0 deletions crates/test-case-core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[package]
name = "test-case-core"
version = "2.2.2"
edition = "2018"
authors = ["Marcin Sas-Szymanski <[email protected]>", "Wojciech Polak <[email protected]>", "Łukasz Biel <[email protected]>"]
description = "Provides core functionality for parsing #[test_case(...)] procedural macro attribute for generating parametrized test cases easily"
keywords = ["test", "case", "tests", "unit", "testing"]
categories = ["development-tools", "development-tools::testing"]
readme = "../../README.md"
license = "MIT"
repository = "https://github.com/frondeus/test-case"
documentation = "https://docs.rs/test-case"

[features]
with-regex = []

[badges]
maintenance = { status = "actively-developed" }

[lib]
doctest = false
path = "src/lib.rs"

[dependencies]
cfg-if = "1.0"
proc-macro2 = { version = "1.0", features = [] }
proc-macro-error = "1.0"
quote = "1.0"
syn = { version = "1.0", features = ["full", "extra-traits"] }
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 10 additions & 0 deletions crates/test-case-core/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
use proc_macro2::TokenStream as TokenStream2;

mod comment;
mod complex_expr;
mod expr;
mod modifier;
mod test_case;
mod utils;

pub use test_case::TestCase;
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 2 additions & 3 deletions crates/test-case-macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ readme = "../../README.md"
license = "MIT"
repository = "https://github.com/frondeus/test-case"
documentation = "https://docs.rs/test-case"
exclude = ["tests/snapshots/**/*"]

[features]
with-regex = []
with-regex = ["test-case-core/with-regex"]

[badges]
maintenance = { status = "actively-developed" }
Expand All @@ -24,8 +23,8 @@ proc-macro = true
path = "src/lib.rs"

[dependencies]
cfg-if = "1.0"
proc-macro2 = { version = "1.0", features = [] }
proc-macro-error = "1.0"
quote = "1.0"
syn = { version = "1.0", features = ["full", "extra-traits"] }
test-case-core = { version = "2.2.2", path = "../test-case-core", default-features = false }
10 changes: 1 addition & 9 deletions crates/test-case-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,10 @@ use proc_macro::TokenStream;

use syn::{parse_macro_input, ItemFn};

use proc_macro2::TokenStream as TokenStream2;
use quote::quote;
use syn::parse_quote;
use syn::spanned::Spanned;
use test_case::TestCase;

mod comment;
mod complex_expr;
mod expr;
mod modifier;
mod test_case;
mod utils;
use test_case_core::TestCase;

/// Generates tests for given set of data
///
Expand Down

0 comments on commit 70a962f

Please sign in to comment.