+ #[test]
+ fn not_applicable_if_function_is_private() {
+ check_assist_not_applicable(generate_documentation_template, r#"fn priv$0ate() {}"#);
+ }
+
+ #[test]
+ fn not_applicable_if_function_is_pub_crate() {
+ check_assist_not_applicable(
+ generate_documentation_template,
+ r#"pub(crate) fn pri$0vate() {}"#,
+ );
+ }
+
+ #[test]
+ fn not_applicable_if_function_is_in_private_mod() {
+ check_assist_not_applicable(
+ generate_documentation_template,
+ r#"
+mod PrivateModule {
+ pub fn pri$0vate() {}
+}"#,
+ );
+ }
+
+ #[test]
+ fn not_applicable_if_function_is_in_pub_crate_mod() {
+ check_assist_not_applicable(
+ generate_documentation_template,
+ r#"
+pub(crate) mod PrivateModule {
+ pub fn pr$0ivate() {}
+}"#,
+ );
+ }
+
+ #[test]
+ fn not_applicable_if_function_is_in_non_public_mod_is_recursive() {
+ check_assist_not_applicable(
+ generate_documentation_template,
+ r#"
+mod ParentPrivateModule {
+ pub mod PrivateModule {
+ pub fn pr$0ivate() {}
+ }
+}"#,
+ );
+ }
+