@@ -37,7 +37,7 @@ suite('WordPartOperations', () => {
3737 test ( 'cursorWordPartLeft - basic' , ( ) => {
3838 const EXPECTED = [
3939 '|start| |line|' ,
40- '|this|Is|A|Camel|Case|Var| |this|_is|_a|_snake|_case|_var | |THIS|_IS|_CAPS|_SNAKE | |this|_IS |Mixed|Use|' ,
40+ '|this|Is|A|Camel|Case|Var| |this_|is_|a_|snake_|case_|var | |THIS_|IS_|CAPS_|SNAKE | |this_|IS |Mixed|Use|' ,
4141 '|end| |line'
4242 ] . join ( '\n' ) ;
4343 const [ text , ] = deserializePipePositions ( EXPECTED ) ;
@@ -67,7 +67,7 @@ suite('WordPartOperations', () => {
6767 } ) ;
6868
6969 test ( 'cursorWordPartLeft - issue #53899: underscores' , ( ) => {
70- const EXPECTED = '|myvar| |=| |\'|demonstration|_____of | |selection| |with| |space|\'' ;
70+ const EXPECTED = '|myvar| |=| |\'|demonstration_____|of | |selection| |with| |space|\'' ;
7171 const [ text , ] = deserializePipePositions ( EXPECTED ) ;
7272 const actualStops = testRepeatedActionAndExtractPositions (
7373 text ,
@@ -83,7 +83,7 @@ suite('WordPartOperations', () => {
8383 test ( 'cursorWordPartRight - basic' , ( ) => {
8484 const EXPECTED = [
8585 'start| |line|' ,
86- '|this|Is|A|Camel|Case|Var| |this_|is_|a_|snake_|case_|var | |THIS_|IS_|CAPS_|SNAKE | |this_|IS |Mixed|Use|' ,
86+ '|this|Is|A|Camel|Case|Var| |this|_is|_a|_snake|_case|_var | |THIS|_IS|_CAPS|_SNAKE | |this|_IS |Mixed|Use|' ,
8787 '|end| |line|'
8888 ] . join ( '\n' ) ;
8989 const [ text , ] = deserializePipePositions ( EXPECTED ) ;
@@ -113,7 +113,7 @@ suite('WordPartOperations', () => {
113113 } ) ;
114114
115115 test ( 'cursorWordPartRight - issue #53899: underscores' , ( ) => {
116- const EXPECTED = 'myvar| |=| |\'|demonstration_____|of | |selection| |with| |space|\'|' ;
116+ const EXPECTED = 'myvar| |=| |\'|demonstration|_____of | |selection| |with| |space|\'|' ;
117117 const [ text , ] = deserializePipePositions ( EXPECTED ) ;
118118 const actualStops = testRepeatedActionAndExtractPositions (
119119 text ,
@@ -145,8 +145,40 @@ suite('WordPartOperations', () => {
145145 assert . deepEqual ( actual , EXPECTED ) ;
146146 } ) ;
147147
148+ test ( 'issue #93239 - cursorWordPartRight' , ( ) => {
149+ const EXPECTED = [
150+ 'foo|_bar|' ,
151+ ] . join ( '\n' ) ;
152+ const [ text , ] = deserializePipePositions ( EXPECTED ) ;
153+ const actualStops = testRepeatedActionAndExtractPositions (
154+ text ,
155+ new Position ( 1 , 1 ) ,
156+ ed => cursorWordPartRight ( ed ) ,
157+ ed => ed . getPosition ( ) ! ,
158+ ed => ed . getPosition ( ) ! . equals ( new Position ( 1 , 8 ) )
159+ ) ;
160+ const actual = serializePipePositions ( text , actualStops ) ;
161+ assert . deepEqual ( actual , EXPECTED ) ;
162+ } ) ;
163+
164+ test ( 'issue #93239 - cursorWordPartLeft' , ( ) => {
165+ const EXPECTED = [
166+ '|foo_|bar' ,
167+ ] . join ( '\n' ) ;
168+ const [ text , ] = deserializePipePositions ( EXPECTED ) ;
169+ const actualStops = testRepeatedActionAndExtractPositions (
170+ text ,
171+ new Position ( 1 , 8 ) ,
172+ ed => cursorWordPartLeft ( ed ) ,
173+ ed => ed . getPosition ( ) ! ,
174+ ed => ed . getPosition ( ) ! . equals ( new Position ( 1 , 1 ) )
175+ ) ;
176+ const actual = serializePipePositions ( text , actualStops ) ;
177+ assert . deepEqual ( actual , EXPECTED ) ;
178+ } ) ;
179+
148180 test ( 'deleteWordPartLeft - basic' , ( ) => {
149- const EXPECTED = '| |/*| |Just| |some| |text| |a|+=| |3| |+|5|-|3| |*/| |this|Is|A|Camel|Case|Var| |this|_is|_a|_snake|_case|_var | |THIS|_IS|_CAPS|_SNAKE | |this|_IS |Mixed|Use' ;
181+ const EXPECTED = '| |/*| |Just| |some| |text| |a|+=| |3| |+|5|-|3| |*/| |this|Is|A|Camel|Case|Var| |this_|is_|a_|snake_|case_|var | |THIS_|IS_|CAPS_|SNAKE | |this_|IS |Mixed|Use' ;
150182 const [ text , ] = deserializePipePositions ( EXPECTED ) ;
151183 const actualStops = testRepeatedActionAndExtractPositions (
152184 text ,
@@ -160,7 +192,7 @@ suite('WordPartOperations', () => {
160192 } ) ;
161193
162194 test ( 'deleteWordPartRight - basic' , ( ) => {
163- const EXPECTED = ' |/*| |Just| |some| |text| |a|+=| |3| |+|5|-|3| |*/| |this|Is|A|Camel|Case|Var| |this_|is_|a_|snake_|case_|var | |THIS_|IS_|CAPS_|SNAKE | |this_|IS |Mixed|Use|' ;
195+ const EXPECTED = ' |/*| |Just| |some| |text| |a|+=| |3| |+|5|-|3| |*/| |this|Is|A|Camel|Case|Var| |this|_is|_a|_snake|_case|_var | |THIS|_IS|_CAPS|_SNAKE | |this|_IS |Mixed|Use|' ;
164196 const [ text , ] = deserializePipePositions ( EXPECTED ) ;
165197 const actualStops = testRepeatedActionAndExtractPositions (
166198 text ,
0 commit comments