use crate::upstream_tests::support::update;
use crate::{
COLLABORATION_TAG, COMPOSITION_END_TAG, COMPOSITION_START_TAG, CreateEditorArgs, Editor,
HISTORIC_TAG, HISTORY_MERGE_TAG, LexicalError, NodeRef, PASTE_TAG, SKIP_COLLAB_TAG,
UpdateOptions, create_editor, create_paragraph_node, create_text_node, get_root,
set_composition_key,
};
use std::collections::HashMap;
use std::rc::Rc;
#[derive(Clone, Copy)]
enum Op {
InsertBefore,
InsertAfter,
InsertOnBothSides,
RemoveTheBoldNodeBefore,
RemoveTheBoldNodeAfter,
UnboldTheNodeBefore,
JoinTheNextLine,
}
impl Op {
fn name(self) -> &'static str {
match self {
Op::InsertBefore => "insert before",
Op::InsertAfter => "insert after",
Op::InsertOnBothSides => "insert on both sides",
Op::RemoveTheBoldNodeBefore => "remove the bold node before",
Op::RemoveTheBoldNodeAfter => "remove the bold node after",
Op::UnboldTheNodeBefore => "unbold the node before",
Op::JoinTheNextLine => "join the next line",
}
}
fn run(self, composed: &NodeRef) -> Result<(), LexicalError> {
match self {
Op::InsertBefore => {
composed.insert_before(&create_text_node("j1z"), true)?;
}
Op::InsertAfter => {
composed.insert_after(&create_text_node("j3z"), true)?;
}
Op::InsertOnBothSides => {
composed.insert_before(&create_text_node("j1z"), true)?;
composed.insert_after(&create_text_node("j3z"), true)?;
}
Op::RemoveTheBoldNodeBefore => {
composed.get_previous_sibling().unwrap().remove(false)?;
}
Op::RemoveTheBoldNodeAfter => {
composed.get_next_sibling().unwrap().remove(false)?;
}
Op::UnboldTheNodeBefore => composed.get_previous_sibling().unwrap().set_format(0.0),
Op::JoinTheNextLine => {
let line = composed.get_parent_or_throw()?;
let next = line.get_next_sibling().unwrap();
line.append(&next.get_children())?;
next.remove(false)?;
}
}
Ok(())
}
}
#[derive(Debug, PartialEq)]
struct Step {
json: String,
nodes: Vec<String>,
}
fn create_test_editor() -> Editor {
create_editor(CreateEditorArgs {
namespace: "test".to_owned(),
..CreateEditorArgs::default()
})
}
fn composed_text() -> NodeRef {
get_root()
.get_all_text_nodes()
.into_iter()
.find(|node| node.get_text_content().contains('に'))
.expect("the composed text is gone")
}
fn discrete(tag: Option<&str>, skip_transforms: bool) -> UpdateOptions {
UpdateOptions {
discrete: true,
tags: tag.into_iter().map(str::to_owned).collect(),
skip_transforms,
..UpdateOptions::default()
}
}
fn run(op: Op, tag: Option<&'static str>, skip_transforms: bool, composing: bool) -> Vec<Step> {
let editor = create_test_editor();
let labels = Rc::new(std::cell::RefCell::new(HashMap::<String, &str>::new()));
let snapshot = |editor: &Editor| {
let labels = labels.clone();
editor
.read(|| Step {
json: editor.get_editor_state().to_json(false).to_string(),
nodes: get_root()
.get_children()
.iter()
.inspect(|node| assert!(node.is_element()))
.flat_map(NodeRef::get_children)
.map(|n| {
format!(
"{}:{}{}",
labels.borrow().get(n.get_key()).copied().unwrap_or("new"),
n.get_text_content(),
if n.is_text() && n.text_data().get_format() != 0.0 {
"{b}"
} else {
""
}
)
})
.collect(),
})
.unwrap()
};
let mut steps = Vec::new();
let l = labels.clone();
editor
.update(
move || {
let before = create_text_node("j1z");
let bold1 = create_text_node("B");
bold1.toggle_format("bold");
let composed = create_text_node("にj2z");
let bold2 = create_text_node("C");
bold2.toggle_format("bold");
let after = create_text_node("j3z");
let joined = create_text_node("k1z");
let is_bold = op.name().contains("bold");
get_root().clear()?;
let line = create_paragraph_node();
line.append(&if is_bold {
vec![
before.clone(),
bold1.clone(),
composed.clone(),
bold2.clone(),
after.clone(),
]
} else {
vec![composed.clone()]
})?;
let next = create_paragraph_node();
next.append(std::slice::from_ref(&joined))?;
get_root().append(&[line, next])?;
for (node, label) in [
(&before, "before"),
(&bold1, "bold1"),
(&composed, "composed"),
(&bold2, "bold2"),
(&after, "after"),
(&joined, "joined"),
] {
l.borrow_mut().insert(node.get_key().to_owned(), label);
}
composed.select(Some(1), Some(1))?;
if composing {
set_composition_key(Some(composed.get_key()));
} else {
crate::lexical_utils::get_writable(composed.get_key());
}
Ok(())
},
discrete(None, false),
)
.unwrap();
steps.push(snapshot(&editor));
editor
.update(
move || op.run(&composed_text()),
discrete(tag, skip_transforms),
)
.unwrap();
steps.push(snapshot(&editor));
update(&editor, || {
let node = composed_text();
node.set_text_content(&node.get_text_content().replacen('に', "にほ", 1));
Ok(())
});
steps.push(snapshot(&editor));
update(&editor, move || {
if composing {
set_composition_key(None);
} else {
crate::lexical_utils::get_writable(composed_text().get_key());
}
Ok(())
});
steps.push(snapshot(&editor));
steps
}
fn same_with_and_without_composition(op: Op, tag: Option<&'static str>, skip_transforms: bool) {
assert_eq!(
run(op, tag, skip_transforms, true),
run(op, tag, skip_transforms, false)
);
}
fn nodes_of(steps: Vec<Step>) -> Vec<Vec<String>> {
steps.into_iter().map(|s| s.nodes).collect()
}
#[test]
fn text_inserted_before_the_composed_node_merges_with_it_at_once() {
assert_eq!(
nodes_of(run(Op::InsertBefore, None, false, true)),
[
["composed:にj2z", "joined:k1z"],
["new:j1zにj2z", "joined:k1z"],
["new:j1zにほj2z", "joined:k1z"],
["new:j1zにほj2z", "joined:k1z"],
]
);
}
#[test]
fn a_line_joined_into_the_composing_line_merges_at_once() {
assert_eq!(
nodes_of(run(Op::JoinTheNextLine, None, true, true)),
[
vec!["composed:にj2z", "joined:k1z"],
vec!["composed:にj2zk1z"],
vec!["composed:にほj2zk1z"],
vec!["composed:にほj2zk1z"],
]
);
}
#[test]
fn insert_before_tag_none() {
same_with_and_without_composition(Op::InsertBefore, None, false);
}
#[test]
fn insert_before_tag_none_skip_transforms() {
same_with_and_without_composition(Op::InsertBefore, None, true);
}
#[test]
fn insert_before_tag_collaboration() {
same_with_and_without_composition(Op::InsertBefore, Some(COLLABORATION_TAG), false);
}
#[test]
fn insert_before_tag_collaboration_skip_transforms() {
same_with_and_without_composition(Op::InsertBefore, Some(COLLABORATION_TAG), true);
}
#[test]
fn insert_before_tag_historic() {
same_with_and_without_composition(Op::InsertBefore, Some(HISTORIC_TAG), false);
}
#[test]
fn insert_before_tag_historic_skip_transforms() {
same_with_and_without_composition(Op::InsertBefore, Some(HISTORIC_TAG), true);
}
#[test]
fn insert_before_tag_history_merge() {
same_with_and_without_composition(Op::InsertBefore, Some(HISTORY_MERGE_TAG), false);
}
#[test]
fn insert_before_tag_history_merge_skip_transforms() {
same_with_and_without_composition(Op::InsertBefore, Some(HISTORY_MERGE_TAG), true);
}
#[test]
fn insert_before_tag_paste() {
same_with_and_without_composition(Op::InsertBefore, Some(PASTE_TAG), false);
}
#[test]
fn insert_before_tag_paste_skip_transforms() {
same_with_and_without_composition(Op::InsertBefore, Some(PASTE_TAG), true);
}
#[test]
fn insert_before_tag_skip_collab() {
same_with_and_without_composition(Op::InsertBefore, Some(SKIP_COLLAB_TAG), false);
}
#[test]
fn insert_before_tag_skip_collab_skip_transforms() {
same_with_and_without_composition(Op::InsertBefore, Some(SKIP_COLLAB_TAG), true);
}
#[test]
fn insert_before_tag_composition_start() {
same_with_and_without_composition(Op::InsertBefore, Some(COMPOSITION_START_TAG), false);
}
#[test]
fn insert_before_tag_composition_start_skip_transforms() {
same_with_and_without_composition(Op::InsertBefore, Some(COMPOSITION_START_TAG), true);
}
#[test]
fn insert_before_tag_composition_end() {
same_with_and_without_composition(Op::InsertBefore, Some(COMPOSITION_END_TAG), false);
}
#[test]
fn insert_before_tag_composition_end_skip_transforms() {
same_with_and_without_composition(Op::InsertBefore, Some(COMPOSITION_END_TAG), true);
}
#[test]
fn insert_after_tag_none() {
same_with_and_without_composition(Op::InsertAfter, None, false);
}
#[test]
fn insert_after_tag_none_skip_transforms() {
same_with_and_without_composition(Op::InsertAfter, None, true);
}
#[test]
fn insert_after_tag_collaboration() {
same_with_and_without_composition(Op::InsertAfter, Some(COLLABORATION_TAG), false);
}
#[test]
fn insert_after_tag_collaboration_skip_transforms() {
same_with_and_without_composition(Op::InsertAfter, Some(COLLABORATION_TAG), true);
}
#[test]
fn insert_after_tag_historic() {
same_with_and_without_composition(Op::InsertAfter, Some(HISTORIC_TAG), false);
}
#[test]
fn insert_after_tag_historic_skip_transforms() {
same_with_and_without_composition(Op::InsertAfter, Some(HISTORIC_TAG), true);
}
#[test]
fn insert_after_tag_history_merge() {
same_with_and_without_composition(Op::InsertAfter, Some(HISTORY_MERGE_TAG), false);
}
#[test]
fn insert_after_tag_history_merge_skip_transforms() {
same_with_and_without_composition(Op::InsertAfter, Some(HISTORY_MERGE_TAG), true);
}
#[test]
fn insert_after_tag_paste() {
same_with_and_without_composition(Op::InsertAfter, Some(PASTE_TAG), false);
}
#[test]
fn insert_after_tag_paste_skip_transforms() {
same_with_and_without_composition(Op::InsertAfter, Some(PASTE_TAG), true);
}
#[test]
fn insert_after_tag_skip_collab() {
same_with_and_without_composition(Op::InsertAfter, Some(SKIP_COLLAB_TAG), false);
}
#[test]
fn insert_after_tag_skip_collab_skip_transforms() {
same_with_and_without_composition(Op::InsertAfter, Some(SKIP_COLLAB_TAG), true);
}
#[test]
fn insert_after_tag_composition_start() {
same_with_and_without_composition(Op::InsertAfter, Some(COMPOSITION_START_TAG), false);
}
#[test]
fn insert_after_tag_composition_start_skip_transforms() {
same_with_and_without_composition(Op::InsertAfter, Some(COMPOSITION_START_TAG), true);
}
#[test]
fn insert_after_tag_composition_end() {
same_with_and_without_composition(Op::InsertAfter, Some(COMPOSITION_END_TAG), false);
}
#[test]
fn insert_after_tag_composition_end_skip_transforms() {
same_with_and_without_composition(Op::InsertAfter, Some(COMPOSITION_END_TAG), true);
}
#[test]
fn insert_on_both_sides_tag_none() {
same_with_and_without_composition(Op::InsertOnBothSides, None, false);
}
#[test]
fn insert_on_both_sides_tag_none_skip_transforms() {
same_with_and_without_composition(Op::InsertOnBothSides, None, true);
}
#[test]
fn insert_on_both_sides_tag_collaboration() {
same_with_and_without_composition(Op::InsertOnBothSides, Some(COLLABORATION_TAG), false);
}
#[test]
fn insert_on_both_sides_tag_collaboration_skip_transforms() {
same_with_and_without_composition(Op::InsertOnBothSides, Some(COLLABORATION_TAG), true);
}
#[test]
fn insert_on_both_sides_tag_historic() {
same_with_and_without_composition(Op::InsertOnBothSides, Some(HISTORIC_TAG), false);
}
#[test]
fn insert_on_both_sides_tag_historic_skip_transforms() {
same_with_and_without_composition(Op::InsertOnBothSides, Some(HISTORIC_TAG), true);
}
#[test]
fn insert_on_both_sides_tag_history_merge() {
same_with_and_without_composition(Op::InsertOnBothSides, Some(HISTORY_MERGE_TAG), false);
}
#[test]
fn insert_on_both_sides_tag_history_merge_skip_transforms() {
same_with_and_without_composition(Op::InsertOnBothSides, Some(HISTORY_MERGE_TAG), true);
}
#[test]
fn insert_on_both_sides_tag_paste() {
same_with_and_without_composition(Op::InsertOnBothSides, Some(PASTE_TAG), false);
}
#[test]
fn insert_on_both_sides_tag_paste_skip_transforms() {
same_with_and_without_composition(Op::InsertOnBothSides, Some(PASTE_TAG), true);
}
#[test]
fn insert_on_both_sides_tag_skip_collab() {
same_with_and_without_composition(Op::InsertOnBothSides, Some(SKIP_COLLAB_TAG), false);
}
#[test]
fn insert_on_both_sides_tag_skip_collab_skip_transforms() {
same_with_and_without_composition(Op::InsertOnBothSides, Some(SKIP_COLLAB_TAG), true);
}
#[test]
fn insert_on_both_sides_tag_composition_start() {
same_with_and_without_composition(Op::InsertOnBothSides, Some(COMPOSITION_START_TAG), false);
}
#[test]
fn insert_on_both_sides_tag_composition_start_skip_transforms() {
same_with_and_without_composition(Op::InsertOnBothSides, Some(COMPOSITION_START_TAG), true);
}
#[test]
fn insert_on_both_sides_tag_composition_end() {
same_with_and_without_composition(Op::InsertOnBothSides, Some(COMPOSITION_END_TAG), false);
}
#[test]
fn insert_on_both_sides_tag_composition_end_skip_transforms() {
same_with_and_without_composition(Op::InsertOnBothSides, Some(COMPOSITION_END_TAG), true);
}
#[test]
fn remove_the_bold_node_before_tag_none() {
same_with_and_without_composition(Op::RemoveTheBoldNodeBefore, None, false);
}
#[test]
fn remove_the_bold_node_before_tag_none_skip_transforms() {
same_with_and_without_composition(Op::RemoveTheBoldNodeBefore, None, true);
}
#[test]
fn remove_the_bold_node_before_tag_collaboration() {
same_with_and_without_composition(Op::RemoveTheBoldNodeBefore, Some(COLLABORATION_TAG), false);
}
#[test]
fn remove_the_bold_node_before_tag_collaboration_skip_transforms() {
same_with_and_without_composition(Op::RemoveTheBoldNodeBefore, Some(COLLABORATION_TAG), true);
}
#[test]
fn remove_the_bold_node_before_tag_historic() {
same_with_and_without_composition(Op::RemoveTheBoldNodeBefore, Some(HISTORIC_TAG), false);
}
#[test]
fn remove_the_bold_node_before_tag_historic_skip_transforms() {
same_with_and_without_composition(Op::RemoveTheBoldNodeBefore, Some(HISTORIC_TAG), true);
}
#[test]
fn remove_the_bold_node_before_tag_history_merge() {
same_with_and_without_composition(Op::RemoveTheBoldNodeBefore, Some(HISTORY_MERGE_TAG), false);
}
#[test]
fn remove_the_bold_node_before_tag_history_merge_skip_transforms() {
same_with_and_without_composition(Op::RemoveTheBoldNodeBefore, Some(HISTORY_MERGE_TAG), true);
}
#[test]
fn remove_the_bold_node_before_tag_paste() {
same_with_and_without_composition(Op::RemoveTheBoldNodeBefore, Some(PASTE_TAG), false);
}
#[test]
fn remove_the_bold_node_before_tag_paste_skip_transforms() {
same_with_and_without_composition(Op::RemoveTheBoldNodeBefore, Some(PASTE_TAG), true);
}
#[test]
fn remove_the_bold_node_before_tag_skip_collab() {
same_with_and_without_composition(Op::RemoveTheBoldNodeBefore, Some(SKIP_COLLAB_TAG), false);
}
#[test]
fn remove_the_bold_node_before_tag_skip_collab_skip_transforms() {
same_with_and_without_composition(Op::RemoveTheBoldNodeBefore, Some(SKIP_COLLAB_TAG), true);
}
#[test]
fn remove_the_bold_node_before_tag_composition_start() {
same_with_and_without_composition(
Op::RemoveTheBoldNodeBefore,
Some(COMPOSITION_START_TAG),
false,
);
}
#[test]
fn remove_the_bold_node_before_tag_composition_start_skip_transforms() {
same_with_and_without_composition(
Op::RemoveTheBoldNodeBefore,
Some(COMPOSITION_START_TAG),
true,
);
}
#[test]
fn remove_the_bold_node_before_tag_composition_end() {
same_with_and_without_composition(
Op::RemoveTheBoldNodeBefore,
Some(COMPOSITION_END_TAG),
false,
);
}
#[test]
fn remove_the_bold_node_before_tag_composition_end_skip_transforms() {
same_with_and_without_composition(Op::RemoveTheBoldNodeBefore, Some(COMPOSITION_END_TAG), true);
}
#[test]
fn remove_the_bold_node_after_tag_none() {
same_with_and_without_composition(Op::RemoveTheBoldNodeAfter, None, false);
}
#[test]
fn remove_the_bold_node_after_tag_none_skip_transforms() {
same_with_and_without_composition(Op::RemoveTheBoldNodeAfter, None, true);
}
#[test]
fn remove_the_bold_node_after_tag_collaboration() {
same_with_and_without_composition(Op::RemoveTheBoldNodeAfter, Some(COLLABORATION_TAG), false);
}
#[test]
fn remove_the_bold_node_after_tag_collaboration_skip_transforms() {
same_with_and_without_composition(Op::RemoveTheBoldNodeAfter, Some(COLLABORATION_TAG), true);
}
#[test]
fn remove_the_bold_node_after_tag_historic() {
same_with_and_without_composition(Op::RemoveTheBoldNodeAfter, Some(HISTORIC_TAG), false);
}
#[test]
fn remove_the_bold_node_after_tag_historic_skip_transforms() {
same_with_and_without_composition(Op::RemoveTheBoldNodeAfter, Some(HISTORIC_TAG), true);
}
#[test]
fn remove_the_bold_node_after_tag_history_merge() {
same_with_and_without_composition(Op::RemoveTheBoldNodeAfter, Some(HISTORY_MERGE_TAG), false);
}
#[test]
fn remove_the_bold_node_after_tag_history_merge_skip_transforms() {
same_with_and_without_composition(Op::RemoveTheBoldNodeAfter, Some(HISTORY_MERGE_TAG), true);
}
#[test]
fn remove_the_bold_node_after_tag_paste() {
same_with_and_without_composition(Op::RemoveTheBoldNodeAfter, Some(PASTE_TAG), false);
}
#[test]
fn remove_the_bold_node_after_tag_paste_skip_transforms() {
same_with_and_without_composition(Op::RemoveTheBoldNodeAfter, Some(PASTE_TAG), true);
}
#[test]
fn remove_the_bold_node_after_tag_skip_collab() {
same_with_and_without_composition(Op::RemoveTheBoldNodeAfter, Some(SKIP_COLLAB_TAG), false);
}
#[test]
fn remove_the_bold_node_after_tag_skip_collab_skip_transforms() {
same_with_and_without_composition(Op::RemoveTheBoldNodeAfter, Some(SKIP_COLLAB_TAG), true);
}
#[test]
fn remove_the_bold_node_after_tag_composition_start() {
same_with_and_without_composition(
Op::RemoveTheBoldNodeAfter,
Some(COMPOSITION_START_TAG),
false,
);
}
#[test]
fn remove_the_bold_node_after_tag_composition_start_skip_transforms() {
same_with_and_without_composition(
Op::RemoveTheBoldNodeAfter,
Some(COMPOSITION_START_TAG),
true,
);
}
#[test]
fn remove_the_bold_node_after_tag_composition_end() {
same_with_and_without_composition(Op::RemoveTheBoldNodeAfter, Some(COMPOSITION_END_TAG), false);
}
#[test]
fn remove_the_bold_node_after_tag_composition_end_skip_transforms() {
same_with_and_without_composition(Op::RemoveTheBoldNodeAfter, Some(COMPOSITION_END_TAG), true);
}
#[test]
fn unbold_the_node_before_tag_none() {
same_with_and_without_composition(Op::UnboldTheNodeBefore, None, false);
}
#[test]
fn unbold_the_node_before_tag_none_skip_transforms() {
same_with_and_without_composition(Op::UnboldTheNodeBefore, None, true);
}
#[test]
fn unbold_the_node_before_tag_collaboration() {
same_with_and_without_composition(Op::UnboldTheNodeBefore, Some(COLLABORATION_TAG), false);
}
#[test]
fn unbold_the_node_before_tag_collaboration_skip_transforms() {
same_with_and_without_composition(Op::UnboldTheNodeBefore, Some(COLLABORATION_TAG), true);
}
#[test]
fn unbold_the_node_before_tag_historic() {
same_with_and_without_composition(Op::UnboldTheNodeBefore, Some(HISTORIC_TAG), false);
}
#[test]
fn unbold_the_node_before_tag_historic_skip_transforms() {
same_with_and_without_composition(Op::UnboldTheNodeBefore, Some(HISTORIC_TAG), true);
}
#[test]
fn unbold_the_node_before_tag_history_merge() {
same_with_and_without_composition(Op::UnboldTheNodeBefore, Some(HISTORY_MERGE_TAG), false);
}
#[test]
fn unbold_the_node_before_tag_history_merge_skip_transforms() {
same_with_and_without_composition(Op::UnboldTheNodeBefore, Some(HISTORY_MERGE_TAG), true);
}
#[test]
fn unbold_the_node_before_tag_paste() {
same_with_and_without_composition(Op::UnboldTheNodeBefore, Some(PASTE_TAG), false);
}
#[test]
fn unbold_the_node_before_tag_paste_skip_transforms() {
same_with_and_without_composition(Op::UnboldTheNodeBefore, Some(PASTE_TAG), true);
}
#[test]
fn unbold_the_node_before_tag_skip_collab() {
same_with_and_without_composition(Op::UnboldTheNodeBefore, Some(SKIP_COLLAB_TAG), false);
}
#[test]
fn unbold_the_node_before_tag_skip_collab_skip_transforms() {
same_with_and_without_composition(Op::UnboldTheNodeBefore, Some(SKIP_COLLAB_TAG), true);
}
#[test]
fn unbold_the_node_before_tag_composition_start() {
same_with_and_without_composition(Op::UnboldTheNodeBefore, Some(COMPOSITION_START_TAG), false);
}
#[test]
fn unbold_the_node_before_tag_composition_start_skip_transforms() {
same_with_and_without_composition(Op::UnboldTheNodeBefore, Some(COMPOSITION_START_TAG), true);
}
#[test]
fn unbold_the_node_before_tag_composition_end() {
same_with_and_without_composition(Op::UnboldTheNodeBefore, Some(COMPOSITION_END_TAG), false);
}
#[test]
fn unbold_the_node_before_tag_composition_end_skip_transforms() {
same_with_and_without_composition(Op::UnboldTheNodeBefore, Some(COMPOSITION_END_TAG), true);
}
#[test]
fn join_the_next_line_tag_none() {
same_with_and_without_composition(Op::JoinTheNextLine, None, false);
}
#[test]
fn join_the_next_line_tag_none_skip_transforms() {
same_with_and_without_composition(Op::JoinTheNextLine, None, true);
}
#[test]
fn join_the_next_line_tag_collaboration() {
same_with_and_without_composition(Op::JoinTheNextLine, Some(COLLABORATION_TAG), false);
}
#[test]
fn join_the_next_line_tag_collaboration_skip_transforms() {
same_with_and_without_composition(Op::JoinTheNextLine, Some(COLLABORATION_TAG), true);
}
#[test]
fn join_the_next_line_tag_historic() {
same_with_and_without_composition(Op::JoinTheNextLine, Some(HISTORIC_TAG), false);
}
#[test]
fn join_the_next_line_tag_historic_skip_transforms() {
same_with_and_without_composition(Op::JoinTheNextLine, Some(HISTORIC_TAG), true);
}
#[test]
fn join_the_next_line_tag_history_merge() {
same_with_and_without_composition(Op::JoinTheNextLine, Some(HISTORY_MERGE_TAG), false);
}
#[test]
fn join_the_next_line_tag_history_merge_skip_transforms() {
same_with_and_without_composition(Op::JoinTheNextLine, Some(HISTORY_MERGE_TAG), true);
}
#[test]
fn join_the_next_line_tag_paste() {
same_with_and_without_composition(Op::JoinTheNextLine, Some(PASTE_TAG), false);
}
#[test]
fn join_the_next_line_tag_paste_skip_transforms() {
same_with_and_without_composition(Op::JoinTheNextLine, Some(PASTE_TAG), true);
}
#[test]
fn join_the_next_line_tag_skip_collab() {
same_with_and_without_composition(Op::JoinTheNextLine, Some(SKIP_COLLAB_TAG), false);
}
#[test]
fn join_the_next_line_tag_skip_collab_skip_transforms() {
same_with_and_without_composition(Op::JoinTheNextLine, Some(SKIP_COLLAB_TAG), true);
}
#[test]
fn join_the_next_line_tag_composition_start() {
same_with_and_without_composition(Op::JoinTheNextLine, Some(COMPOSITION_START_TAG), false);
}
#[test]
fn join_the_next_line_tag_composition_start_skip_transforms() {
same_with_and_without_composition(Op::JoinTheNextLine, Some(COMPOSITION_START_TAG), true);
}
#[test]
fn join_the_next_line_tag_composition_end() {
same_with_and_without_composition(Op::JoinTheNextLine, Some(COMPOSITION_END_TAG), false);
}
#[test]
fn join_the_next_line_tag_composition_end_skip_transforms() {
same_with_and_without_composition(Op::JoinTheNextLine, Some(COMPOSITION_END_TAG), true);
}