Skip to content

Commit

Permalink
cfg blocks using cfg-if
Browse files Browse the repository at this point in the history
  • Loading branch information
simsekgokhan committed Apr 17, 2024
1 parent 7c6346f commit 2499538
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/cfg_if.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// cfg blocks
// https://crates.io/crates/cfg-if

// lib.rs
cfg_if::cfg_if! {
if #[cfg(test)] {
pub mod integration_tests;
pub const TEST_PATH: &'static str = "src/integration_tests/";
} else {
}
}

// calc_engine.rs
cfg_if::cfg_if! {
if #[cfg(test)] {
use crate::utils::assert_nodes_rust_vs_ts_test;
use crate::TEST_PATH;
} else { }
}

0 comments on commit 2499538

Please sign in to comment.