(Apparent) bug: approx_equals always returns true if one input is empty?
For me, this test fails:
pub use derive_deftly;
use derive_deftly::{define_derive_deftly,Deftly};
define_derive_deftly! {
pub Wobbling =
impl $ttype {
pub fn wobble_status(&self) -> &'static str {
${if approx_equal({wobble}, {}) {
"bug"
} else {
"okay"
}}
}
}
}
#[derive(Deftly)]
#[derive_deftly(Wobbling)]
pub struct Wobbler {
}
#[test]
fn check() {
assert_eq!(Wobbler {}.wobble_status(), "okay");
}
I would have expected that approx_equal({wobble}, {})
would always be false.