suppress unused warning in kitchensink example (#14417)

* suppress unused warning in kitchensink example

* Adds test

* ".git/.scripts/commands/fmt/fmt.sh"

---------

Co-authored-by: Nikhil Gupta <17176722+gupnik@users.noreply.github.com>
Co-authored-by: command-bot <>
This commit is contained in:
Sam Johnson
2023-06-21 18:13:50 -04:00
committed by GitHub
parent 38cc4ad6aa
commit e783d98437
@@ -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;
@@ -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));
});
}