mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 12:21:32 +00:00
frame-support: migrate some tests from decl_* macros to the new pallet macros (#12401)
* frame-support: migrate some tests from decl macros to new pallet attribute macros * Remove useless type alias * Remove useless type alias * Work around for rust issue 52234 Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Fix tests Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Use polkadot-compatible paste version Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Fix crate access and add tests Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Typo Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> --------- Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by: parity-processbot <>
This commit is contained in:
@@ -1054,3 +1054,23 @@ mod tests {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// NOTE: we have to test the sp_core stuff also from a different crate to check that the macro
|
||||
// can access the sp_core crate.
|
||||
#[cfg(test)]
|
||||
mod sp_core_tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
#[should_panic]
|
||||
fn generate_feature_enabled_macro_panics() {
|
||||
sp_core::generate_feature_enabled_macro!(if_test, test, $);
|
||||
if_test!(panic!("This should panic"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn generate_feature_enabled_macro_works() {
|
||||
sp_core::generate_feature_enabled_macro!(if_not_test, not(test), $);
|
||||
if_not_test!(panic!("This should not panic"));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user