Remove another supported exemption

This commit is contained in:
Conrad Irwin 2023-09-12 11:24:48 -06:00
parent dcaba9d9e7
commit 0958def770
3 changed files with 30 additions and 22 deletions

View file

@ -356,7 +356,7 @@ mod test {
use crate::{ use crate::{
state::Mode::{self}, state::Mode::{self},
test::{ExemptionFeatures, NeovimBackedTestContext}, test::NeovimBackedTestContext,
}; };
#[gpui::test] #[gpui::test]
@ -762,20 +762,22 @@ mod test {
#[gpui::test] #[gpui::test]
async fn test_dd(cx: &mut gpui::TestAppContext) { async fn test_dd(cx: &mut gpui::TestAppContext) {
let mut cx = NeovimBackedTestContext::new(cx).await.binding(["d", "d"]); let mut cx = NeovimBackedTestContext::new(cx).await;
cx.assert("ˇ").await; cx.assert_neovim_compatible("ˇ", ["d", "d"]).await;
cx.assert("The ˇquick").await; cx.assert_neovim_compatible("The ˇquick", ["d", "d"]).await;
cx.assert_all(indoc! {" for marked_text in cx.each_marked_position(indoc! {"
The qˇuick The qˇuick
brown ˇfox brown ˇfox
jumps ˇover"}) jumps ˇover"})
.await; {
cx.assert_exempted( cx.assert_neovim_compatible(&marked_text, ["d", "d"]).await;
}
cx.assert_neovim_compatible(
indoc! {" indoc! {"
The quick The quick
ˇ ˇ
brown fox"}, brown fox"},
ExemptionFeatures::DeletionOnEmptyLine, ["d", "d"],
) )
.await; .await;
} }

View file

@ -322,24 +322,31 @@ mod test {
let mut cx = NeovimBackedTestContext::new(cx) let mut cx = NeovimBackedTestContext::new(cx)
.await .await
.binding(["d", "g", "g"]); .binding(["d", "g", "g"]);
cx.assert_neovim_compatible(indoc! {" cx.assert_neovim_compatible(
indoc! {"
The quick The quick
brownˇ fox brownˇ fox
jumps over jumps over
the lazy"}, ["d", "g", "g"]) the lazy"},
.await; ["d", "g", "g"],
cx.assert_neovim_compatible(indoc! {" )
.await;
cx.assert_neovim_compatible(
indoc! {"
The quick The quick
brown fox brown fox
jumps over jumps over
the lˇazy"}, ["d", "g", "g"]) the lˇazy"},
.await; ["d", "g", "g"],
)
.await;
cx.assert_neovim_compatible( cx.assert_neovim_compatible(
indoc! {" indoc! {"
The qˇuick The qˇuick
brown fox brown fox
jumps over jumps over
the lazy"},["d", "g", "g"] the lazy"},
["d", "g", "g"],
) )
.await; .await;
cx.assert_neovim_compatible( cx.assert_neovim_compatible(
@ -347,7 +354,8 @@ mod test {
ˇ ˇ
brown fox brown fox
jumps over jumps over
the lazy"},["d", "g", "g"] the lazy"},
["d", "g", "g"],
) )
.await; .await;
} }

View file

@ -13,15 +13,13 @@ use util::test::{generate_marked_text, marked_text_offsets};
use super::{neovim_connection::NeovimConnection, NeovimBackedBindingTestContext, VimTestContext}; use super::{neovim_connection::NeovimConnection, NeovimBackedBindingTestContext, VimTestContext};
use crate::state::Mode; use crate::state::Mode;
pub const SUPPORTED_FEATURES: &[ExemptionFeatures] = &[ExemptionFeatures::DeletionOnEmptyLine]; pub const SUPPORTED_FEATURES: &[ExemptionFeatures] = &[];
/// Enum representing features we have tests for but which don't work, yet. Used /// Enum representing features we have tests for but which don't work, yet. Used
/// to add exemptions and automatically /// to add exemptions and automatically
#[derive(PartialEq, Eq)] #[derive(PartialEq, Eq)]
pub enum ExemptionFeatures { pub enum ExemptionFeatures {
// MOTIONS // MOTIONS
// Deletions on empty lines miss some newlines
DeletionOnEmptyLine,
// When an operator completes at the end of the file, an extra newline is left // When an operator completes at the end of the file, an extra newline is left
OperatorLastNewlineRemains, OperatorLastNewlineRemains,
// Deleting a word on an empty line doesn't remove the newline // Deleting a word on an empty line doesn't remove the newline