RegressionTests__Widgets.st
author Claus Gittinger <cg@exept.de>
Tue, 26 Mar 2019 18:29:04 +0100
changeset 2169 a1a0194d9890
parent 2113 4ac641a0c67d
child 2192 b0aedc917f4e
permissions -rw-r--r--
#OTHER by cg class: TestCase category of: #setUp #tearDown

"{ 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$'
! !