2113
|
1 |
"{ Package: 'stx:goodies/regression' }"
|
|
2 |
|
|
3 |
"{ NameSpace: RegressionTests }"
|
|
4 |
|
|
5 |
TestCase subclass:#Widgets
|
|
6 |
instanceVariableNames:''
|
|
7 |
classVariableNames:''
|
|
8 |
poolDictionaries:''
|
|
9 |
category:'tests-Regression-UI'
|
|
10 |
!
|
|
11 |
|
|
12 |
|
|
13 |
!Widgets class methodsFor:'queries'!
|
|
14 |
|
|
15 |
coveredClassNames
|
|
16 |
"should be redefined to return a collection of classes which are tested by
|
|
17 |
this suite/case.
|
|
18 |
If not redefined, coveredPackageNames should be.
|
|
19 |
|
|
20 |
These classes can be instrumented for coverage analysis,
|
|
21 |
before running the suite to provide coverage analysis/report"
|
|
22 |
|
|
23 |
^ #( EditTextView )
|
|
24 |
|
|
25 |
"Created: / 06-07-2011 / 21:27:03 / cg"
|
|
26 |
"Modified: / 21-03-2019 / 13:02:41 / Claus Gittinger"
|
|
27 |
! !
|
|
28 |
|
|
29 |
!Widgets methodsFor:'tests'!
|
|
30 |
|
|
31 |
test10_editTextView
|
|
32 |
|editWidget rslt|
|
|
33 |
|
|
34 |
editWidget := EditTextView new.
|
|
35 |
editWidget contents:c'line1\nline2\nline3'.
|
|
36 |
|
|
37 |
"/ notice the additional newline at the end
|
|
38 |
self assert:(editWidget contents = c'line1\nline2\nline3\n').
|
|
39 |
|
|
40 |
self assert:(editWidget cursorLine == 1).
|
|
41 |
self assert:(editWidget cursorCol == 1).
|
|
42 |
|
|
43 |
rslt := editWidget lineStringBeforeCursor.
|
|
44 |
self assert:(rslt = '').
|
|
45 |
|
|
46 |
editWidget cursorLine:2 col:1.
|
|
47 |
rslt := editWidget lineStringBeforeCursor.
|
|
48 |
self assert:(rslt = '').
|
|
49 |
|
|
50 |
editWidget cursorLine:2 col:3.
|
|
51 |
rslt := editWidget lineStringBeforeCursor.
|
|
52 |
self assert:(rslt = 'li').
|
|
53 |
|
|
54 |
editWidget cursorLine:2 col:20.
|
|
55 |
rslt := editWidget lineStringBeforeCursor.
|
|
56 |
self assert:(rslt = 'line2').
|
|
57 |
|
|
58 |
"
|
|
59 |
self new test10_editTextView
|
|
60 |
"
|
|
61 |
|
|
62 |
"Created: / 21-03-2019 / 13:02:23 / Claus Gittinger"
|
|
63 |
! !
|
|
64 |
|
|
65 |
!Widgets class methodsFor:'documentation'!
|
|
66 |
|
|
67 |
version_CVS
|
|
68 |
^ '$Header$'
|
|
69 |
! !
|
|
70 |
|