diff --git a/primitives/api/test/tests/ui/positive_cases/empty_impl_runtime_apis.rs b/primitives/api/test/tests/ui/positive_cases/empty_impl_runtime_apis.rs new file mode 100644 index 0000000000000..39d2bc1a96478 --- /dev/null +++ b/primitives/api/test/tests/ui/positive_cases/empty_impl_runtime_apis.rs @@ -0,0 +1,11 @@ +// Do not use `construct_runtime!`. +struct Runtime; + +// Empty `impl_runtime_apis!` cannot deduce the Runtime name +// and should not implement the `runtime_metadata()` method. +sp_api::impl_runtime_apis! {} + +// Expect the test to compile because this has the effect of +// not calling `construct_runtime!` nor `impl_runtime_apis!` +// for the Runtime. +fn main() {}