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

Commit e72781c

Browse files
sam0x17gupnik
andauthored
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 <[email protected]> Co-authored-by: command-bot <>
1 parent 3413493 commit e72781c

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

frame/examples/kitchensink/src/tests.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
//! Tests for pallet-example-kitchensink.
1919
2020
use crate::*;
21-
use frame_support::{derive_impl, parameter_types, traits::ConstU64};
21+
use frame_support::{assert_ok, derive_impl, parameter_types, traits::ConstU64};
2222
use sp_runtime::BuildStorage;
2323
// Reexport crate as its pallet name for construct_runtime.
2424
use crate as pallet_example_kitchensink;
@@ -100,3 +100,14 @@ pub fn new_test_ext() -> sp_io::TestExternalities {
100100
.unwrap();
101101
t.into()
102102
}
103+
104+
#[test]
105+
fn set_foo_works() {
106+
new_test_ext().execute_with(|| {
107+
assert_eq!(Foo::<Test>::get(), Some(24)); // From genesis config.
108+
109+
let val1 = 42;
110+
assert_ok!(Kitchensink::set_foo(RuntimeOrigin::root(), val1, 2));
111+
assert_eq!(Foo::<Test>::get(), Some(val1));
112+
});
113+
}

0 commit comments

Comments
 (0)