Skip to content

Commit 285e151

Browse files
author
greg
committed
integration tests
1 parent bc8df20 commit 285e151

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

helix-term/tests/test/commands.rs

+26
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,29 @@ async fn test_selection_duplication() -> anyhow::Result<()> {
131131
.await?;
132132
Ok(())
133133
}
134+
135+
#[tokio::test]
136+
async fn increment_integer_test() -> anyhow::Result<()> {
137+
// correct selection placement with multiple -1 to zero
138+
// `-1-1-2-1-1` becomes `00-100`
139+
test((
140+
"#[-|]#1#(-|)#1#(-|)#2#(-|)#1#(-|)#1",
141+
"<C-a>",
142+
"#[0|]##(0|)##(-|)#1#(0|)##(0|)#",
143+
))
144+
.await?;
145+
146+
// correct selection placement with multiple -1 to zero, incremented twice
147+
// `-1-1-2-1-1` becomes `00-100` then `01-99`
148+
test((
149+
"#[-|]#1#(-|)#1#(-|)#2#(-|)#1#(-|)#1",
150+
"<C-a><C-a>",
151+
"#[0|]#1#(-|)#99",
152+
))
153+
.await?;
154+
155+
// correct selection placement with multiple 9 to 10
156+
// `9 9 9` becomes `10 10 10`
157+
test(("#[9|]# #(9|)# #(9|)#", "<C-a>", "#[1|]#0 #(1|)#0 #(1|)#0")).await?;
158+
Ok(())
159+
}

0 commit comments

Comments
 (0)