diff --git a/substrate/frame/support/test/example-pallet-doc.md b/substrate/frame/support/test/example-pallet-doc.md new file mode 100644 index 000000000000..3935e7e8eaed --- /dev/null +++ b/substrate/frame/support/test/example-pallet-doc.md @@ -0,0 +1 @@ +This is the best pallet diff --git a/substrate/frame/support/test/example-readme.md b/substrate/frame/support/test/example-readme.md new file mode 100644 index 000000000000..fdee294df9dd --- /dev/null +++ b/substrate/frame/support/test/example-readme.md @@ -0,0 +1 @@ +Very important information :D diff --git a/substrate/frame/support/test/tests/pallet.rs b/substrate/frame/support/test/tests/pallet.rs index 6f8af949cc31..eed8a22e8e79 100644 --- a/substrate/frame/support/test/tests/pallet.rs +++ b/substrate/frame/support/test/tests/pallet.rs @@ -114,8 +114,8 @@ impl SomeAssociation2 for u64 { #[frame_support::pallet] /// Pallet documentation // Comments should not be included in the pallet documentation -#[pallet_doc("../../README.md")] -#[doc = include_str!("../../README.md")] +#[pallet_doc("../example-pallet-doc.md")] +#[doc = include_str!("../example-readme.md")] pub mod pallet { use super::*; use frame_support::pallet_prelude::*; @@ -1408,8 +1408,9 @@ fn metadata() { use codec::Decode; use frame_metadata::{v15::*, *}; - let readme = "Support code for the runtime.\n\nLicense: Apache-2.0\n"; - let expected_pallet_doc = vec![" Pallet documentation", readme, readme]; + let readme = "Very important information :D\n"; + let pallet_doc = "This is the best pallet\n"; + let expected_pallet_doc = vec![" Pallet documentation", readme, pallet_doc]; let pallets = vec![ PalletMetadata { @@ -1911,8 +1912,9 @@ fn metadata_ir_pallet_runtime_docs() { .find(|pallet| pallet.name == "Example") .expect("Pallet should be present"); - let readme = "Support code for the runtime.\n\nLicense: Apache-2.0\n"; - let expected = vec![" Pallet documentation", readme, readme]; + let readme = "Very important information :D\n"; + let pallet_doc = "This is the best pallet\n"; + let expected = vec![" Pallet documentation", readme, pallet_doc]; assert_eq!(pallet.docs, expected); } @@ -1941,8 +1943,9 @@ fn extrinsic_metadata_ir_types() { #[test] fn test_pallet_runtime_docs() { let docs = crate::pallet::Pallet::::pallet_documentation_metadata(); - let readme = "Support code for the runtime.\n\nLicense: Apache-2.0\n"; - let expected = vec![" Pallet documentation", readme, readme]; + let readme = "Very important information :D\n"; + let pallet_doc = "This is the best pallet\n"; + let expected = vec![" Pallet documentation", readme, pallet_doc]; assert_eq!(docs, expected); }