Commit db96d60 greg
committed
1 parent bc8df20 commit db96d60 Copy full SHA for db96d60
File tree 1 file changed +31
-0
lines changed
1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -131,3 +131,34 @@ async fn test_selection_duplication() -> anyhow::Result<()> {
131
131
. await ?;
132
132
Ok ( ( ) )
133
133
}
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
+ platform_line ( indoc ! { "#[-|]#1#(-|)#1#(-|)#2#(-|)#1#(-|)#1" } ) . as_str ( ) ,
141
+ "<C-a>" ,
142
+ platform_line ( indoc ! { "#[0|]##(0|)##(-|)#1#(0|)##(0|)#" } ) . as_str ( ) ,
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
+ platform_line ( indoc ! { "#[-|]#1#(-|)#1#(-|)#2#(-|)#1#(-|)#1" } ) . as_str ( ) ,
150
+ "<C-a><C-a>" ,
151
+ platform_line ( indoc ! { "#[0|]#1#(-|)#99" } ) . as_str ( ) ,
152
+ ) )
153
+ . await ?;
154
+
155
+ // correct selection placement with multiple 9 to 10
156
+ // `9 9 9` becomes `10 10 10`
157
+ test ( (
158
+ platform_line ( indoc ! { "#[9|]# #(9|)# #(9|)#" } ) . as_str ( ) ,
159
+ "<C-a>" ,
160
+ platform_line ( indoc ! { "#[1|]#0 #(1|)#0 #(1|)#0" } ) . as_str ( ) ,
161
+ ) )
162
+ . await ?;
163
+ Ok ( ( ) )
164
+ }
You can’t perform that action at this time.
0 commit comments