| 60 | test_02a |
| 61 | "Checking if white spaces on a blank line are preserved. Scenario: |
| 62 | 1) ensures trimBlankLines is set to false |
| 63 | 2) enter white spaces and a text at the end |
| 64 | 3) move cursor to end of white spaces |
| 65 | 4) press return |
| 66 | 5) move cursor to next line |
| 67 | 6) press backspace |
| 68 | 7) assert: that textView contents returns text |
| 69 | including white spaces at the beginning" |
| 70 | |
| 71 | |wasOn| |
| 72 | |
| 73 | textView trimBlankLines: false. |
| 74 | |
| 75 | textViewInteractor type:Character space. |
| 76 | textViewInteractor type:Character space. |
| 77 | textViewInteractor type:Character space. |
| 78 | textViewInteractor type:'test'. |
| 79 | |
| 80 | wasOn := textView hideCursor. |
| 81 | textView setCursorCol:4. |
| 82 | wasOn ifTrue:[ |
| 83 | textView showCursor |
| 84 | ]. |
| 85 | |
| 86 | textViewInteractor type:#Return. |
| 87 | |
| 88 | wasOn := textView hideCursor. |
| 89 | textView setCursorLine:2. |
| 90 | textView setCursorCol:1. |
| 91 | wasOn ifTrue:[ |
| 92 | textView showCursor |
| 93 | ]. |
| 94 | |
| 95 | textViewInteractor type:#BackSpace. |
| 96 | |
| 97 | MessageTracer unwrapMethod:(UserPreferences instanceBehavior compiledMethodAt:#trimBlankLines). |
| 98 | |
| 99 | self assert:textView contents asString = (' test' , Character cr). |
| 100 | |
| 101 | "Created: / 26-09-2017 / 11:24:34 / svestkap" |
| 102 | "Modified: / 04-10-2017 / 23:05:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
| 103 | ! |
| 104 | |
| 105 | test_02b |
| 106 | "Checking if white spaces on a blank line are preserved. Scenario: |
| 107 | 1) ensures trimBlankLines is set to true |
| 108 | 2) enter white spaces and a text at the end |
| 109 | 3) move cursor to end of white spaces |
| 110 | 4) press return |
| 111 | 5) move cursor to next line |
| 112 | 6) press backspace |
| 113 | 7) assert: that textView contents returns text |
| 114 | disregarding white spaces at the beginning" |
| 115 | |
| 116 | |wasOn| |
| 117 | |
| 118 | textView trimBlankLines: true. |
| 119 | |
| 120 | textViewInteractor type:Character space. |
| 121 | textViewInteractor type:Character space. |
| 122 | textViewInteractor type:Character space. |
| 123 | textViewInteractor type:'test'. |
| 124 | |
| 125 | wasOn := textView hideCursor. |
| 126 | textView setCursorCol:4. |
| 127 | wasOn ifTrue:[ |
| 128 | textView showCursor |
| 129 | ]. |
| 130 | |
| 131 | textViewInteractor type:#Return. |
| 132 | |
| 133 | wasOn := textView hideCursor. |
| 134 | textView setCursorLine:2. |
| 135 | textView setCursorCol:1. |
| 136 | wasOn ifTrue:[ |
| 137 | textView showCursor |
| 138 | ]. |
| 139 | |
| 140 | textViewInteractor type:#BackSpace. |
| 141 | |
| 142 | |
| 143 | self assert:textView contents asString = ('test' , Character cr). |
| 144 | |
| 145 | "Created: / 26-09-2017 / 11:46:54 / svestkap" |
| 146 | "Modified: / 04-10-2017 / 23:05:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
| 147 | ! |
| 148 | |
| 149 | test_02c |
| 150 | "Checking if white spaces on a blank line are preserved. Scenario: |
| 151 | 1) ensures trimBlankLines is set to false |
| 152 | 2) enter text with String crlf in the middle, which moves |
| 153 | the text after crlf to next line |
| 154 | 3) move cursor to end first line |
| 155 | 4) enter white spaces |
| 156 | 5) move cursor to the next line |
| 157 | 6) press backspace |
| 158 | 7) assert: that textView contents returns a text |
| 159 | which should contain number of white spaces entered" |
| 160 | |
| 161 | |wasOn| |
| 162 | |
| 163 | textView trimBlankLines: false. |
| 164 | |
| 165 | textView contents:'This text is to', String crlf, 'continue'. |
| 166 | |
| 167 | wasOn := textView hideCursor. |
| 168 | textView setCursorLine:1. |
| 169 | textView setCursorCol:16. |
| 170 | wasOn ifTrue:[ |
| 171 | textView showCursor |
| 172 | ]. |
| 173 | |
| 174 | textViewInteractor type: Character space. |
| 175 | textViewInteractor type: Character space. |
| 176 | textViewInteractor type: Character space. |
| 177 | |
| 178 | wasOn := textView hideCursor. |
| 179 | textView setCursorLine:2. |
| 180 | textView setCursorCol:1. |
| 181 | wasOn ifTrue:[ |
| 182 | textView showCursor |
| 183 | ]. |
| 184 | |
| 185 | textViewInteractor type: #BackSpace. |
| 186 | |
| 187 | |
| 188 | self assert:textView contents asString = ('This text is to continue', String crlf). |
| 189 | |
| 190 | "Created: / 17-08-2017 / 09:23:10 / svestkap" |
| 191 | "Modified: / 26-09-2017 / 12:00:17 / svestkap" |
| 192 | "Modified: / 04-10-2017 / 23:05:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
| 193 | ! |
| 194 | |
| 195 | test_02d |
| 196 | "Checking if white spaces on a blank line are preserved. Scenario: |
| 197 | 1) ensures trimBlankLines is set to true |
| 198 | 2) enter text with String crlf in the middle, which moves |
| 199 | the text after crlf to next line |
| 200 | 3) move cursor to end first line |
| 201 | 4) enter white spaces |
| 202 | 5) move cursor to the next line |
| 203 | 6) press backspace |
| 204 | 7) assert: that textView contents returns a text |
| 205 | disregarding the white spaces entered" |
| 206 | |
| 207 | |wasOn| |
| 208 | |
| 209 | textView trimBlankLines: true. |
| 210 | |
| 211 | textView contents:'This text is to', String crlf, 'continue'. |
| 212 | |
| 213 | wasOn := textView hideCursor. |
| 214 | textView setCursorLine:1. |
| 215 | textView setCursorCol:16. |
| 216 | wasOn ifTrue:[ |
| 217 | textView showCursor |
| 218 | ]. |
| 219 | |
| 220 | textViewInteractor type: Character space. |
| 221 | textViewInteractor type: Character space. |
| 222 | textViewInteractor type: Character space. |
| 223 | |
| 224 | wasOn := textView hideCursor. |
| 225 | textView setCursorLine:2. |
| 226 | textView setCursorCol:1. |
| 227 | wasOn ifTrue:[ |
| 228 | textView showCursor |
| 229 | ]. |
| 230 | |
| 231 | textViewInteractor type: #BackSpace. |
| 232 | |
| 233 | self assert:textView contents asString = ('This text is tocontinue', String crlf). |
| 234 | |
| 235 | "Created: / 17-08-2017 / 09:23:10 / svestkap" |
| 236 | "Modified: / 26-09-2017 / 12:00:17 / svestkap" |
| 237 | "Modified: / 04-10-2017 / 23:05:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
| 238 | ! |
| 239 | |