tests/EditTextViewTests.st
branchjv
changeset 6565 e4757590c90c
parent 6380 a7880352d58c
--- a/tests/EditTextViewTests.st	Wed Nov 28 13:16:38 2018 +0000
+++ b/tests/EditTextViewTests.st	Tue Mar 19 15:13:59 2019 +0000
@@ -91,6 +91,64 @@
     "Created: / 24-02-2015 / 08:21:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
+test_02a
+    textView contents: 'Hello, here is Smalltalk X'. 
+    textView setCursorCol: 14.
+
+    textViewInteractor type: #SelectWord.
+    self assert: textView selectionAsString = 'is'.
+
+    textViewInteractor type: #CursorRight.
+    self assert: textView hasSelection not.
+    self assert: textView cursorCol == 15.
+
+    "Created: / 19-03-2019 / 14:58:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_02b
+    textView contents: 'Hello, here is Smalltalk X'. 
+    textView setCursorCol: 14.
+
+    textViewInteractor type: #SelectWord.
+    self assert: textView selectionAsString = 'is'.
+
+    textViewInteractor type: #NextWord.
+    self assert: textView hasSelection not.
+    self assert: textView cursorCol == 16.
+
+    "Created: / 19-03-2019 / 14:59:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 19-03-2019 / 15:03:48 / jv"
+!
+
+test_02c
+    textView contents: 'Hello, here is Smalltalk X'. 
+    textView setCursorCol: 14.
+
+    textViewInteractor type: #SelectWord.
+    self assert: textView selectionAsString = 'is'.
+
+    textViewInteractor type: #CursorLeft.
+    self assert: textView hasSelection not.
+    self assert: textView cursorCol == 13.
+
+    "Created: / 19-03-2019 / 15:02:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_02d
+    textView contents: 'Hello, here is Smalltalk X'. 
+    textView setCursorCol: 14.
+
+    textViewInteractor type: #SelectWord.
+    self assert: textView selectionAsString = 'is'.
+
+    textViewInteractor type: #PreviousWord.
+    self assert: textView hasSelection not.
+    self assert: textView cursorCol == 13.
+
+    "Created: / 19-03-2019 / 15:02:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 19-03-2019 / 15:04:56 / jv"
+!
+
 test_issue124_case1_01
     "
     See https://swing.fit.cvut.cz/projects/stx-jv/ticket/124#comment:19