Logo: Relish

  1. Sign in

Project: Redcar

Soft and hard tabs

Scenarios
Move left through soft tabs
When
I open a new edit tab
And
tabs are soft, 2 spaces
And
I replace the contents with " "
And
I move the cursor to 4
And
I press the Left key in the edit tab
Then
the cursor should be at 2
Move right through soft tabs
When
I open a new edit tab
And
tabs are soft, 2 spaces
And
I replace the contents with " "
And
I move the cursor to 0
And
I press the Right key in the edit tab
Then
the cursor should be at 2
Moves left through part of a soft tab
When
I open a new edit tab
And
tabs are soft, 4 spaces
And
I replace the contents with "Hacker "
And
I move the cursor to 8
And
I press the Left key in the edit tab
Then
the cursor should be at 6
Moves right through part of a soft tab
When
I open a new edit tab
And
tabs are soft, 4 spaces
And
I replace the contents with "Hacker "
And
I move the cursor to 6
And
I press the Right key in the edit tab
Then
the cursor should be at 8
Moves left through spaces that don't make a full tab
When
I open a new edit tab
And
tabs are soft, 4 spaces
And
I replace the contents with "Hacker "
And
I move the cursor to 10
And
I press the Left key in the edit tab
Then
the cursor should be at 9
Moves right through spaces that don't make a full tab
When
I open a new edit tab
And
tabs are soft, 4 spaces
And
I replace the contents with "Hacker "
And
I move the cursor to 8
And
I press the Right key in the edit tab
Then
the cursor should be at 9
Shouldn't die if the cursor is at the start of the document
When
I open a new edit tab
And
tabs are soft, 4 spaces
And
I replace the contents with ""
And
I move the cursor to 0
And
I press the Left key in the edit tab
Then
the cursor should be at 0
Shouldn't die if the cursor is at the end of the document
When
I open a new edit tab
And
tabs are soft, 4 spaces
And
I replace the contents with ""
And
I move the cursor to 0
And
I press the Right key in the edit tab
Then
the cursor should be at 0
Move left through soft tabs, with a tab character
When
I open a new edit tab
And
tabs are soft, 4 spaces
And
I replace the contents with "\tHa "
And
I move the cursor to 1
And
I press the Left key in the edit tab
Then
the cursor should be at 0
Move left through soft tabs 2, with a tab character
When
I open a new edit tab
And
tabs are soft, 4 spaces
And
I replace the contents with "\tHa "
And
I move the cursor to 2
And
I press the Left key in the edit tab
Then
the cursor should be at 1
Move left through soft tabs 2, with a tab character
When
I open a new edit tab
And
tabs are soft, 4 spaces
And
I replace the contents with "\tHa "
And
I move the cursor to 4
And
I press the Left key in the edit tab
Then
the cursor should be at 3
Move left through soft tabs 3, with a tab character
When
I open a new edit tab
And
tabs are soft, 4 spaces
And
I replace the contents with "\tHa "
And
I move the cursor to 5
And
I press the Left key in the edit tab
Then
the cursor should be at 3
Move left through soft tabs 4, with a tab character
When
I open a new edit tab
And
tabs are soft, 4 spaces
And
I replace the contents with "\tHa "
And
I move the cursor to 6
And
I press the Left key in the edit tab
Then
the cursor should be at 5
Move right through soft tabs, with a tab character
When
I open a new edit tab
And
tabs are soft, 4 spaces
And
I replace the contents with "\tHa "
And
I move the cursor to 0
And
I press the Right key in the edit tab
Then
the cursor should be at 1
Move right through soft tabs 2, with a tab character
When
I open a new edit tab
And
tabs are soft, 4 spaces
And
I replace the contents with "\tHa "
And
I move the cursor to 1
And
I press the Right key in the edit tab
Then
the cursor should be at 2
Move right through soft tabs 2, with a tab character
When
I open a new edit tab
And
tabs are soft, 4 spaces
And
I replace the contents with "\tHa "
And
I move the cursor to 3
And
I press the Right key in the edit tab
Then
the cursor should be at 5
Move right through soft tabs 3, with a tab character
When
I open a new edit tab
And
tabs are soft, 4 spaces
And
I replace the contents with "\tHa "
And
I move the cursor to 5
And
I press the Right key in the edit tab
Then
the cursor should be at 6
Move left through soft tabs, with a tab character ahead
When
I open a new edit tab
And
tabs are soft, 4 spaces
And
I replace the contents with " Wo\t"
And
I move the cursor to 4
And
I press the Left key in the edit tab
Then
the cursor should be at 0
Select left through soft tabs
When
I open a new edit tab
And
tabs are soft, 2 spaces
And
I replace the contents with " "
And
I move the cursor to 4
And
I press Shift+Left key in the edit tab
Then
the contents should be " <c> <s>"
Select right through soft tabs
When
I open a new edit tab
And
tabs are soft, 2 spaces
And
I replace the contents with " "
And
I move the cursor to 2
And
I press Shift+Right key in the edit tab
Then
the contents should be " <s> <c>"
Select left twice through soft tabs
When
I open a new edit tab
And
tabs are soft, 2 spaces
And
I replace the contents with " "
And
I move the cursor to 4
And
I press Shift+Left key in the edit tab
And
I press Shift+Left key in the edit tab
Then
the contents should be "<c> <s>"
Select right through soft tabs
When
I open a new edit tab
And
tabs are soft, 2 spaces
And
I replace the contents with " "
And
I move the cursor to 0
And
I press Shift+Right key in the edit tab
And
I press Shift+Right key in the edit tab
Then
the contents should be "<s> <c>"
Shouldn't die if the cursor is at the start of the document
When
I open a new edit tab
And
tabs are soft, 4 spaces
And
I replace the contents with ""
And
I move the cursor to 0
And
I press Shift+Left key in the edit tab
Then
the cursor should be at 0
Shouldn't die if the cursor is at the end of the document
When
I open a new edit tab
And
tabs are soft, 4 spaces
And
I replace the contents with ""
And
I move the cursor to 0
And
I press Shift+Right key in the edit tab
Then
the cursor should be at 0
Can backspace a soft tab
When
I open a new edit tab
And
tabs are soft, 4 spaces
And
I replace the contents with " "
And
I move the cursor to 4
And
I press the Backspace key in the edit tab
Then
the contents should be "<c>"
Can backspace part of a soft tab
When
I open a new edit tab
And
tabs are soft, 4 spaces
And
I replace the contents with "Ha "
And
I move the cursor to 4
And
I press the Backspace key in the edit tab
Then
the contents should be "Ha<c>"
Can delete a soft tab
When
I open a new edit tab
And
tabs are soft, 4 spaces
And
I replace the contents with " "
And
I move the cursor to 0
And
I press the Delete key in the edit tab
Then
the contents should be "<c>"
Can delete part of a soft tab
When
I open a new edit tab
And
tabs are soft, 4 spaces
And
I replace the contents with "Ha "
And
I move the cursor to 2
And
I press the Delete key in the edit tab
Then
the contents should be "Ha<c>"
Move left at the start of a line
When
I open a new edit tab
And
I replace the contents with "Hi\nHo"
And
I move the cursor to 3
And
I press the Left key in the edit tab
Then
the contents should be "Hi<c>\nHo"
Shouldn't die if the cursor is at the end of the document
When
I open a new edit tab
And
tabs are soft, 4 spaces
And
I replace the contents with ""
And
I move the cursor to 0
And
I press the Delete key in the edit tab
Then
the cursor should be at 0

Last published almost 5 years ago by danlucraft.