Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

suppress unused warning in kitchensink example #14417

Merged
merged 5 commits into from
Jun 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion frame/examples/kitchensink/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
//! Tests for pallet-example-kitchensink.

use crate::*;
use frame_support::{derive_impl, parameter_types, traits::ConstU64};
use frame_support::{assert_ok, derive_impl, parameter_types, traits::ConstU64};
use sp_runtime::BuildStorage;
// Reexport crate as its pallet name for construct_runtime.
use crate as pallet_example_kitchensink;
Expand Down Expand Up @@ -100,3 +100,14 @@ pub fn new_test_ext() -> sp_io::TestExternalities {
.unwrap();
t.into()
}

#[test]
fn set_foo_works() {
new_test_ext().execute_with(|| {
assert_eq!(Foo::<Test>::get(), Some(24)); // From genesis config.

let val1 = 42;
assert_ok!(Kitchensink::set_foo(RuntimeOrigin::root(), val1, 2));
assert_eq!(Foo::<Test>::get(), Some(val1));
});
}