initial checkin
authorClaus Gittinger <cg@exept.de>
Thu, 21 Mar 2019 13:15:32 +0100
changeset 2113 4ac641a0c67d
parent 2112 3e51f70c1b03
child 2114 daad296b9762
initial checkin
RegressionTests__Widgets.st
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/RegressionTests__Widgets.st	Thu Mar 21 13:15:32 2019 +0100
@@ -0,0 +1,70 @@
+"{ Package: 'stx:goodies/regression' }"
+
+"{ NameSpace: RegressionTests }"
+
+TestCase subclass:#Widgets
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	category:'tests-Regression-UI'
+!
+
+
+!Widgets class methodsFor:'queries'!
+
+coveredClassNames
+    "should be redefined to return a collection of classes which are tested by
+     this suite/case.
+     If not redefined, coveredPackageNames should be.
+
+     These classes can be instrumented for coverage analysis,
+     before running the suite to provide coverage analysis/report"
+
+    ^ #( EditTextView )
+
+    "Created: / 06-07-2011 / 21:27:03 / cg"
+    "Modified: / 21-03-2019 / 13:02:41 / Claus Gittinger"
+! !
+
+!Widgets methodsFor:'tests'!
+
+test10_editTextView
+    |editWidget rslt|
+
+    editWidget := EditTextView new.
+    editWidget contents:c'line1\nline2\nline3'.
+
+    "/ notice the additional newline at the end
+    self assert:(editWidget contents = c'line1\nline2\nline3\n').
+
+    self assert:(editWidget cursorLine == 1).
+    self assert:(editWidget cursorCol == 1).
+
+    rslt := editWidget lineStringBeforeCursor.
+    self assert:(rslt = '').
+    
+    editWidget cursorLine:2 col:1.
+    rslt := editWidget lineStringBeforeCursor.
+    self assert:(rslt = '').
+    
+    editWidget cursorLine:2 col:3.
+    rslt := editWidget lineStringBeforeCursor.
+    self assert:(rslt = 'li').
+
+    editWidget cursorLine:2 col:20.
+    rslt := editWidget lineStringBeforeCursor.
+    self assert:(rslt = 'line2').
+
+    "
+     self new test10_editTextView
+    "
+
+    "Created: / 21-03-2019 / 13:02:23 / Claus Gittinger"
+! !
+
+!Widgets class methodsFor:'documentation'!
+
+version_CVS
+    ^ '$Header$'
+! !
+