Issue #230: added tests jv
authorJan Vrany <jan.vrany@fit.cvut.cz>
Tue, 17 Jul 2018 19:34:22 +0200
branchjv
changeset 6380 a7880352d58c
parent 6367 ced1d9fb356c
child 6435 6466b859a54d
Issue #230: added tests https://swing.fit.cvut.cz/projects/stx-jv/ticket/230
tests/EditTextViewTests.st
--- a/tests/EditTextViewTests.st	Mon Jul 02 08:46:01 2018 +0200
+++ b/tests/EditTextViewTests.st	Tue Jul 17 19:34:22 2018 +0200
@@ -63,7 +63,7 @@
     topView waitUntilVisible.
 
     "Created: / 23-07-2014 / 07:15:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified (format): / 12-10-2017 / 23:17:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 17-07-2018 / 09:43:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 tearDown
@@ -412,6 +412,86 @@
     self assert: textView selectionEndCol == 8.
 
     "Created: / 11-10-2017 / 22:35:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_ussue230_01a
+    "
+     Test paste over selection
+        1. Copy some code to clipboard
+        2. Select word in an editor
+        3. Paste
+
+     Check, that selected code has been replaced by
+     pasted text.
+"
+    
+    textView contents:'Here is some word.'.
+    textView 
+        selectFromLine:1
+        col:9
+        toLine:1
+        col:12.
+    self assert:textView selection first = 'some'.
+    textView setClipboardText:'pasted'.
+    textViewInteractor type:#Paste.
+    self assert:textView selection first = 'pasted'.
+    self assert:textView contents = 'Here is pasted word.
+'.
+
+    "Created: / 17-07-2018 / 09:28:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 17-07-2018 / 09:28:42 / jv"
+!
+
+test_ussue230_01b
+    "
+     Test paste over selection
+        1. Copy some code to clipboard
+        2. Select word in an editor using select-world
+        3. Paste
+
+     Check, that selected code has been replaced by
+     pasted text.
+"
+    
+    textView contents:'Here is some word.'.
+    textView setCursorCol:10.
+    textViewInteractor type:#SelectWord.
+    self assert:textView selection first = 'some'.
+    textView setClipboardText:'pasted'.
+    textViewInteractor type:#Paste.
+    self assert:textView selection first = 'pasted'.
+    self assert:textView contents = 'Here is pasted word.
+'.
+
+    "Created: / 17-07-2018 / 09:38:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 17-07-2018 / 09:39:21 / jv"
+!
+
+test_ussue230_01c
+    "
+     Test paste over selection
+        1. Copy some code to clipboard using select world, then copy.
+        2. Select word in an editor using select-world
+        3. Paste
+
+     Check, that selected code has been replaced by
+     pasted text.
+"
+    
+    textView contents:'Here is some word.'.
+    textView setCursorCol:10.
+    textViewInteractor type:#SelectWord.
+    self assert:textView selection first = 'some'.
+    textViewInteractor type:#Copy.
+    textView setCursorCol:3.
+    textViewInteractor type:#SelectWord.
+    self assert:textView selection first = 'Here'.
+    textViewInteractor type:#Paste.
+    self assert:textView selection first = 'some'.
+    self assert:textView contents = 'some is some word.
+'.
+
+    "Created: / 17-07-2018 / 10:13:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !EditTextViewTests class methodsFor:'documentation'!