/ features / text-mode-expansions.feature
text-mode-expansions.feature
 1  Feature: Text-mode expansions
 2    Background:
 3      Given there is no region selected
 4      And I turn on text-mode
 5      And I insert:
 6      """
 7      Lorem ipsum dolor sit amet, consectetur adipiscing elit.
 8      Here is a sentence.  Here is another.  And one with Dr. Baker.
 9  
10      Another paragraph.  With 2 sentences.
11      
12      "We're on a different page," said the man.
13      """
14  
15    Scenario: Mark sentence ending on a line
16      When I place the cursor after "consectetur"
17      And I press "C-@"
18      Then the region should be "consectetur"
19      And I press "C-@"
20      Then the region should be "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
21      And I press "C-@"
22      Then the region should be:
23      """
24      Lorem ipsum dolor sit amet, consectetur adipiscing elit.
25      Here is a sentence.  Here is another.  And one with Dr. Baker.
26  
27      """
28  
29    Scenario: Mark sentence ending on a line 2
30      When I place the cursor before "Lorem"
31      And I press "C-@"
32      Then the region should be "Lorem"
33      And I press "C-@"
34      Then the region should be "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
35      And I press "C-@"
36      Then the region should be:
37      """
38      Lorem ipsum dolor sit amet, consectetur adipiscing elit.
39      Here is a sentence.  Here is another.  And one with Dr. Baker.
40  
41      """
42  
43    Scenario: Mark sentence beginning a line
44      When I place the cursor after "sentence."
45      And I press "C-@"
46      Then the region should be "sentence."
47      And I press "C-@"
48      Then the region should be "Here is a sentence."
49      And I press "C-@"
50      Then the region should be:
51      """
52      Lorem ipsum dolor sit amet, consectetur adipiscing elit.
53      Here is a sentence.  Here is another.  And one with Dr. Baker.
54  
55      """
56  
57    Scenario: Mark sentence in the middle of a line
58      When I place the cursor before "is another"
59      And I press "C-@"
60      Then the region should be "is"
61      And I press "C-@"
62      Then the region should be "Here is another."
63      And I press "C-@"
64      Then the region should be:
65      """
66      Lorem ipsum dolor sit amet, consectetur adipiscing elit.
67      Here is a sentence.  Here is another.  And one with Dr. Baker.
68  
69      """
70  
71    Scenario: Mark sentence in the middle of a line
72      When I place the cursor after "Baker."
73      And I press "C-@"
74      Then the region should be "Baker."
75      And I press "C-@"
76      Then the region should be "And one with Dr. Baker."
77      And I press "C-@"
78      Then the region should be:
79      """
80      Lorem ipsum dolor sit amet, consectetur adipiscing elit.
81      Here is a sentence.  Here is another.  And one with Dr. Baker.
82  
83      """
84  
85    Scenario: Sentence endings
86      When I place the cursor before "Dr."
87      And I set sentence-end-double-space to nil
88      And I press "C-u 3 C-@"
89      Then the region should be "And one with Dr."
90  
91    Scenario: Sentence endings 2
92      When I place the cursor before "Dr."
93      And I set sentence-end-double-space to t
94      And I press "C-u 3 C-@"
95      Then the region should be "And one with Dr. Baker."
96      # I turned sentence-end-double-space back to the default here in
97      # case it comes into play in other tests.