Skip to content

Commit 2578826

Browse files
authored
refactor: use new style modules, flatten tests (#149)
1 parent 9663dde commit 2578826

12 files changed

Lines changed: 18 additions & 13 deletions

File tree

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ pub mod syntax;
1515
use syntax::{Captures, Keyword};
1616

1717
#[cfg(test)]
18-
mod tests;
18+
#[path = "annotate_tests.rs"]
19+
mod annotate_tests;
1920

2021
impl Parse for Spec {
2122
fn parse(input: ParseStream) -> Result<Self> {
File renamed without changes.
File renamed without changes.

crates/anodized-core/src/instrument/data/mod.rs renamed to crates/anodized-core/src/instrument/data.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1+
#[cfg(test)]
2+
#[path = "data_tests.rs"]
3+
mod data_tests;
4+
15
use proc_macro2::TokenStream;
26
use quote::ToTokens;
37
use syn::{ItemEnum, ItemImpl, ItemStruct, Result, parse_quote};
48

59
use crate::{DataSpec, instrument::Config};
610

7-
#[cfg(test)]
8-
mod tests;
9-
1011
impl Config {
1112
pub fn instrument_item_struct(
1213
&self,
File renamed without changes.

crates/anodized-core/src/instrument/fns/mod.rs renamed to crates/anodized-core/src/instrument/fns.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
#[cfg(test)]
2-
mod tests;
3-
4-
use crate::{
5-
Capture, PostCondition, PreCondition, Spec,
6-
instrument::{Config, build_assert, build_eprint},
7-
qualifiers::FnQualifiers,
8-
};
2+
#[path = "fns_tests.rs"]
3+
mod fns_tests;
94

105
use proc_macro2::Span;
116
use quote::{ToTokens, quote};
@@ -15,6 +10,12 @@ use syn::{
1510
parse_quote,
1611
};
1712

13+
use crate::{
14+
Capture, PostCondition, PreCondition, Spec,
15+
instrument::{Config, build_assert, build_eprint},
16+
qualifiers::FnQualifiers,
17+
};
18+
1819
impl Config {
1920
pub fn instrument_fn(&self, spec: &Spec, sig: &Signature, body: &mut Block) -> syn::Result<()> {
2021
self.instrument_loops_in_fn_body(body)?;
File renamed without changes.

crates/anodized-core/src/instrument/loops/mod.rs renamed to crates/anodized-core/src/instrument/loops.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#[cfg(test)]
2-
mod tests;
2+
#[path = "loops_tests.rs"]
3+
mod loops_tests;
34

45
use syn::{
56
Block, Error, ExprClosure, ExprForLoop, ExprWhile, ItemFn, Result, Stmt, parse_quote,
File renamed without changes.

crates/anodized-core/src/instrument/traits/mod.rs renamed to crates/anodized-core/src/instrument/traits.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#[cfg(test)]
2-
mod tests;
2+
#[path = "traits_tests.rs"]
3+
mod traits_tests;
34

45
use quote::quote;
56
use syn::{

0 commit comments

Comments
 (0)