| 85 | ! |
| 86 | |
| 87 | test_issue124_01 |
| 88 | |
| 89 | textView contents: '1234'. |
| 90 | textView setCursorCol: 3. |
| 91 | textView selectToEndOfLine. |
| 92 | self assert: textView selectionAsString = '34'. |
| 93 | |
| 94 | textView setClipboardText: 'Smalltalk'. |
| 95 | textViewInteractor type: #Paste. "/ this simulates pressing Ctrl-V |
| 96 | self assert: textView selectionAsString = 'Smalltalk'. |
| 97 | self assert: textView contents asString = ('12Smalltalk' , Character cr). |
| 98 | |
| 99 | textViewInteractor type: #Undo. "/ This simulates pressing Ctrl-Z |
| 100 | self assert: textView contents asString = ('1234' , Character cr). |
| 101 | |
| 102 | "Created: / 17-03-2017 / 09:46:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
| 103 | ! |
| 104 | |
| 105 | test_issue124_02 |
| 106 | |
| 107 | textView contents: '1234'. |
| 108 | textView setCursorCol: 3. |
| 109 | textView selectToEndOfLine. |
| 110 | self assert: textView selectionAsString = '34'. |
| 111 | |
| 112 | textView setClipboardText: '1-LINEA |
| 113 | 2-LINEB |
| 114 | 3-LINEC |
| 115 | '. |
| 116 | textViewInteractor type: #Paste. "/ this simulates pressing Ctrl-V |
| 117 | self assert: textView selectionAsString = '1-LINEA |
| 118 | 2-LINEB |
| 119 | 3-LINEC |
| 120 | '. |
| 121 | self assert: textView contents asString = ('121-LINEA |
| 122 | 2-LINEB |
| 123 | 3-LINEC |
| 124 | '). |
| 125 | |
| 126 | textViewInteractor type: #Undo. "/ This simulates pressing Ctrl-Z |
| 127 | self assert: textView contents asString = ('1234' , Character cr). |
| 128 | |
| 129 | "Created: / 17-03-2017 / 09:48:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
| 130 | "Modified: / 17-03-2017 / 14:13:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
| 131 | ! |
| 132 | |
| 133 | test_issue124_03 |
| 134 | |
| 135 | textView contents: '1234'. |
| 136 | textView setCursorCol: 3. |
| 137 | textView selectToEndOfLine. |
| 138 | self assert: textView selectionAsString = '34'. |
| 139 | |
| 140 | textView setClipboardText: '1-LINEA |
| 141 | 2-LINEB |
| 142 | 3-LINEC |
| 143 | '. |
| 144 | textViewInteractor type: #Paste. "/ this simulates pressing Ctrl-V |
| 145 | self assert: textView selectionAsString = '1-LINEA |
| 146 | 2-LINEB |
| 147 | 3-LINEC |
| 148 | '. |
| 149 | self assert: textView contents asString = ('121-LINEA |
| 150 | 2-LINEB |
| 151 | 3-LINEC |
| 152 | '). |
| 153 | textViewInteractor type: 'Simsalabim'. |
| 154 | self assert: textView contents asString = ('121-LINEA |
| 155 | 2-LINEB |
| 156 | 3-LINEC |
| 157 | Simsalabim |
| 158 | '). |
| 159 | self assert: (textView instVarNamed: #cursorVisibleLine) == 4. |
| 160 | |
| 161 | "Created: / 17-03-2017 / 19:38:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
| 162 | ! |
| 163 | |
| 164 | test_issue124_04 |
| 165 | |
| 166 | textViewInteractor type: '1234'. |
| 167 | self assert: textView contents asString = ('1234' , Character cr). |
| 168 | |
| 169 | textViewInteractor type: #Undo. "/ This simulates pressing Ctrl-Z |
| 170 | self assert: textView contents asString = ('' , Character cr). |
| 171 | |
| 172 | "Created: / 17-03-2017 / 21:42:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
| 173 | ! |
| 174 | |
| 175 | test_issue124_05 |
| 176 | |
| 177 | textViewInteractor type: '1234'. |
| 178 | self assert: textView contents asString = ('1234' , Character cr). |
| 179 | |
| 180 | textView setClipboardText: 'Blah blag'. |
| 181 | textViewInteractor type: #Paste. |
| 182 | self assert: textView contents asString = ('1234Blah blag' , Character cr). |
| 183 | |
| 184 | |
| 185 | textViewInteractor type: #Undo. "/ This simulates pressing Ctrl-Z |
| 186 | self assert: textView contents asString = ('1234' , Character cr). |
| 187 | |
| 188 | textViewInteractor type: #Undo. "/ This simulates pressing Ctrl-Z |
| 189 | self assert: textView contents asString = ('' , Character cr). |
| 190 | |
| 191 | "Created: / 17-03-2017 / 22:43:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
| 192 | ! |
| 193 | |
| 194 | test_issue124_06a |
| 195 | | text | |
| 196 | |
| 197 | text := #[34 80 97 115 116 101 32 99 111 112 121 98 117 102 102 101 114 32 40 99 108 105 112 98 111 97 114 100 41 34 10 32 115 101 108 102 32 112 97 115 116 101 79 114 82 101 112 108 97 99 101 10 10 32 9 34 77 111 100 105 102 105 101 100 58 32 47 32 49 50 45 48 51 45 50 48 49 55 32 47 32 50 49 58 52 54 58 53 57 32 47 32 74 97 110 32 86 114 97 110 121 32 106 97 110 46 118 114 97 110 121 64 102 105 116 46 99 118 117 116 46 99 122 34] asString. |
| 198 | |
| 199 | self assert: textView contents asString = ''. |
| 200 | textView setClipboardText: text. |
| 201 | textViewInteractor type: #Paste. |
| 202 | textViewInteractor type: #Undo. "/ This simulates pressing Ctrl-Z |
| 203 | self assert: textView contents asString = ('', Character cr). |
| 204 | |
| 205 | "Created: / 20-03-2017 / 17:42:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
| 206 | ! |
| 207 | |
| 208 | test_issue124_06b |
| 209 | | text | |
| 210 | |
| 211 | text := '12345' , Character linefeed , |
| 212 | Character space , Character tab , '67890'. |
| 213 | textView setClipboardText: text. |
| 214 | textViewInteractor type: #Paste. |
| 215 | textViewInteractor type: #Undo. "/ This simulates pressing Ctrl-Z |
| 216 | self assert: textView contents asString = ('', Character cr). |
| 217 | |
| 218 | "Created: / 20-03-2017 / 20:54:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
| 219 | ! |
| 220 | |
| 221 | test_issue124_06c |
| 222 | | text | |
| 223 | |
| 224 | text := '12345' , Character linefeed , |
| 225 | Character space , Character tab , '67890'. |
| 226 | textView contents: 'ABCDE'. |
| 227 | textView setClipboardText: text. |
| 228 | textViewInteractor type: #Paste. |
| 229 | textViewInteractor type: #Undo. "/ This simulates pressing Ctrl-Z |
| 230 | self assert: textView contents asString = ('ABCDE', Character cr). |
| 231 | |
| 232 | "Created: / 20-03-2017 / 21:33:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
| 233 | "Modified: / 21-03-2017 / 22:28:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
| 234 | ! |
| 235 | |
| 236 | test_issue124_06d |
| 237 | | text | |
| 238 | |
| 239 | text := Character tab , '67890'. |
| 240 | textView contents: 'ABCD'. |
| 241 | textView cursorCol: 3. |
| 242 | textView setClipboardText: text. |
| 243 | textViewInteractor type: #Paste. |
| 244 | textViewInteractor type: #Undo. "/ This simulates pressing Ctrl-Z |
| 245 | self assert: textView contents asString = ('ABCD', Character cr). |
| 246 | |
| 247 | "Created: / 21-03-2017 / 22:35:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |