Skip to content
Snippets Groups Projects
Commit f590b06f authored by Alexander Popiak's avatar Alexander Popiak Committed by GitHub
Browse files

remove std feature flags for assert macros (#7600)

* remove std feature flags for assert macros

* re-add note about availability in no_std envs
parent 5774fea2
Branches
No related merge requests found
...@@ -102,9 +102,8 @@ pub enum Never {} ...@@ -102,9 +102,8 @@ pub enum Never {}
/// ///
/// - Using `static` to create a static parameter type. Its value is /// - Using `static` to create a static parameter type. Its value is
/// being provided by a static variable with the equivalent name in `UPPER_SNAKE_CASE`. An /// being provided by a static variable with the equivalent name in `UPPER_SNAKE_CASE`. An
/// additional `set` function is provided in this case to alter the static variable. /// additional `set` function is provided in this case to alter the static variable.
/// /// **This is intended for testing ONLY and is ONLY available when `std` is enabled.**
/// **This is intended for testing ONLY and is ONLY available when `std` is enabled**
/// ///
/// # Examples /// # Examples
/// ///
...@@ -488,7 +487,6 @@ macro_rules! ensure { ...@@ -488,7 +487,6 @@ macro_rules! ensure {
/// ///
/// Used as `assert_noop(expression_to_assert, expected_error_expression)`. /// Used as `assert_noop(expression_to_assert, expected_error_expression)`.
#[macro_export] #[macro_export]
#[cfg(feature = "std")]
macro_rules! assert_noop { macro_rules! assert_noop {
( (
$x:expr, $x:expr,
...@@ -504,7 +502,6 @@ macro_rules! assert_noop { ...@@ -504,7 +502,6 @@ macro_rules! assert_noop {
/// ///
/// Used as `assert_err!(expression_to_assert, expected_error_expression)` /// Used as `assert_err!(expression_to_assert, expected_error_expression)`
#[macro_export] #[macro_export]
#[cfg(feature = "std")]
macro_rules! assert_err { macro_rules! assert_err {
( $x:expr , $y:expr $(,)? ) => { ( $x:expr , $y:expr $(,)? ) => {
assert_eq!($x, Err($y.into())); assert_eq!($x, Err($y.into()));
...@@ -516,7 +513,6 @@ macro_rules! assert_err { ...@@ -516,7 +513,6 @@ macro_rules! assert_err {
/// This can be used on`DispatchResultWithPostInfo` when the post info should /// This can be used on`DispatchResultWithPostInfo` when the post info should
/// be ignored. /// be ignored.
#[macro_export] #[macro_export]
#[cfg(feature = "std")]
macro_rules! assert_err_ignore_postinfo { macro_rules! assert_err_ignore_postinfo {
( $x:expr , $y:expr $(,)? ) => { ( $x:expr , $y:expr $(,)? ) => {
$crate::assert_err!($x.map(|_| ()).map_err(|e| e.error), $y); $crate::assert_err!($x.map(|_| ()).map_err(|e| e.error), $y);
...@@ -525,7 +521,6 @@ macro_rules! assert_err_ignore_postinfo { ...@@ -525,7 +521,6 @@ macro_rules! assert_err_ignore_postinfo {
/// Assert an expression returns error with the given weight. /// Assert an expression returns error with the given weight.
#[macro_export] #[macro_export]
#[cfg(feature = "std")]
macro_rules! assert_err_with_weight { macro_rules! assert_err_with_weight {
($call:expr, $err:expr, $weight:expr $(,)? ) => { ($call:expr, $err:expr, $weight:expr $(,)? ) => {
if let Err(dispatch_err_with_post) = $call { if let Err(dispatch_err_with_post) = $call {
...@@ -542,7 +537,6 @@ macro_rules! assert_err_with_weight { ...@@ -542,7 +537,6 @@ macro_rules! assert_err_with_weight {
/// Used as `assert_ok!(expression_to_assert, expected_ok_expression)`, /// Used as `assert_ok!(expression_to_assert, expected_ok_expression)`,
/// or `assert_ok!(expression_to_assert)` which would assert against `Ok(())`. /// or `assert_ok!(expression_to_assert)` which would assert against `Ok(())`.
#[macro_export] #[macro_export]
#[cfg(feature = "std")]
macro_rules! assert_ok { macro_rules! assert_ok {
( $x:expr $(,)? ) => { ( $x:expr $(,)? ) => {
let is = $x; let is = $x;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment