RegressionTests__Widgets.st
author Claus Gittinger <cg@exept.de>
Tue, 09 Jul 2019 18:53:03 +0200
changeset 2327 bf482d49aeaf
parent 2200 b35d6460de52
child 2577 9a9a91ebd2d0
permissions -rw-r--r--
#QUALITY by exept class: RegressionTests::StringTests added: #test82c_expanding

"{ Encoding: utf8 }"

"{ 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|

    self skipIf:Display isNil description:'no Display'.
    
    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              ').           "/ lineStringBeforCursor pads to col with blanks

    "
     self new test10_editTextView
    "

    "Created: / 21-03-2019 / 13:02:23 / Claus Gittinger"
    "Modified (comment): / 27-03-2019 / 15:34:04 / stefan"
    "Modified: / 28-03-2019 / 15:58:02 / Claus Gittinger"
! !

!Widgets class methodsFor:'documentation'!

version_CVS
    ^ '$Header$'
! !