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