Skip to content

Commit

Permalink
Only run f32 tests if f32 available
Browse files Browse the repository at this point in the history
  • Loading branch information
jacg committed Aug 18, 2022
1 parent 2339288 commit a5528dc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/tests/impl_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

// Helper functions for constructing a variety of Quantities without excessive
// syntactic noise.
#[allow(unused_macros)]
mod concise {

// Bring the units used by the constructors into a limited scope
Expand Down Expand Up @@ -45,6 +46,7 @@ mod concise {
};
}

#[cfg(feature = "f32")]
constructors! { f32
wrap!( m Length meter);
wrap!( km Length kilometer);
Expand Down Expand Up @@ -76,6 +78,7 @@ mod concise {
/// In other words, the side-effect test is distinguished from the expression
/// test, by wrapping the left operand (the one which will be mutated by the
/// operator) in square brackets.
#[allow(unused_macros)]
macro_rules! test {
($test_name:ident [$lhs:expr] $op:tt $rhs:expr, $expected:expr) => {
#[test]
Expand All @@ -97,6 +100,7 @@ macro_rules! test {
// provides the functionality being tested, according to the table shown here:
// https://github.com/iliekturtles/uom/pull/307#issuecomment-1186208970
#[rustfmt::skip]
#[cfg(feature = "f32")]
mod vv {
mod autoconvert_no {
use super::super::concise::f32::*;
Expand Down

0 comments on commit a5528dc

Please sign in to comment.