From 893f4c8ece7d9869b4f0e08b8e1483c9a1c7e65e Mon Sep 17 00:00:00 2001 From: Nik Revenco Date: Wed, 11 Jun 2025 12:42:46 +0100 Subject: [PATCH] test: add tests for align-text --- helix-term/tests/test/commands.rs | 1 + helix-term/tests/test/commands/align_text.rs | 65 ++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 helix-term/tests/test/commands/align_text.rs diff --git a/helix-term/tests/test/commands.rs b/helix-term/tests/test/commands.rs index 2af1a054f..64e8ab1cb 100644 --- a/helix-term/tests/test/commands.rs +++ b/helix-term/tests/test/commands.rs @@ -2,6 +2,7 @@ use helix_term::application::Application; use super::*; +mod align_text; mod insert; mod movement; mod write; diff --git a/helix-term/tests/test/commands/align_text.rs b/helix-term/tests/test/commands/align_text.rs new file mode 100644 index 000000000..795cae565 --- /dev/null +++ b/helix-term/tests/test/commands/align_text.rs @@ -0,0 +1,65 @@ +use super::*; + +const IN: &str = indoc! {" + #[pub fn docgen() -> Result<(), DynError> { + use crate::docgen::*; + write(TYPABLE_COMMANDS_MD_OUTPUT, &typable_commands()?); + write(STATIC_COMMANDS_MD_OUTPUT, &static_commands()?); + write(LANG_SUPPORT_MD_OUTPUT, &lang_features()?); + Ok(()) + }\n|]#"}; + +#[tokio::test(flavor = "multi_thread")] +async fn left() -> anyhow::Result<()> { + test(( + IN, + ":align-text-left", + indoc! {"\ + #[pub fn docgen() -> Result<(), DynError> { + use crate::docgen::*; + write(TYPABLE_COMMANDS_MD_OUTPUT, &typable_commands()?); + write(STATIC_COMMANDS_MD_OUTPUT, &static_commands()?); + write(LANG_SUPPORT_MD_OUTPUT, &lang_features()?); + Ok(()) + }\n|]#"}, + )) + .await?; + + Ok(()) +} +#[tokio::test(flavor = "multi_thread")] +async fn center() -> anyhow::Result<()> { + test(( + IN, + ":align-text-center", + indoc! {"\ + #[ pub fn docgen() -> Result<(), DynError> { + use crate::docgen::*; + write(TYPABLE_COMMANDS_MD_OUTPUT, &typable_commands()?); + write(STATIC_COMMANDS_MD_OUTPUT, &static_commands()?); + write(LANG_SUPPORT_MD_OUTPUT, &lang_features()?); + Ok(()) + }\n|]#"}, + )) + .await?; + + Ok(()) +} +#[tokio::test(flavor = "multi_thread")] +async fn right() -> anyhow::Result<()> { + test(( + IN, + ":align-text-right", + indoc! {"\ + #[ pub fn docgen() -> Result<(), DynError> { + use crate::docgen::*; + write(TYPABLE_COMMANDS_MD_OUTPUT, &typable_commands()?); + write(STATIC_COMMANDS_MD_OUTPUT, &static_commands()?); + write(LANG_SUPPORT_MD_OUTPUT, &lang_features()?); + Ok(()) + }\n|]#"}, + )) + .await?; + + Ok(()) +}