SmallSense__EditSupportTests.st
author Stefan Vogel <sv@exept.de>
Mon, 04 Mar 2019 13:09:59 +0100
branchcvs_MAIN
changeset 1085 a22655fd60b5
parent 273 404662b42ddf
child 374 e65bd2bf892a
permissions -rw-r--r--
#REFACTORING by stefan class: SmallSense::AbstractJavaCompletionEngineSimple changed: #guessTypeOfExpressionBefore:in: fixed shadowed var
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
257
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     1
"
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     2
stx:goodies/smallsense - A productivity plugin for Smalltalk/X IDE
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     3
Copyright (C) 2013-2014 Jan Vrany
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     4
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     5
This library is free software; you can redistribute it and/or
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     6
modify it under the terms of the GNU Lesser General Public
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     7
License as published by the Free Software Foundation; either
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     8
version 2.1 of the License. 
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     9
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    10
This library is distributed in the hope that it will be useful,
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    11
but WITHOUT ANY WARRANTY; without even the implied warranty of
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    13
Lesser General Public License for more details.
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    14
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    15
You should have received a copy of the GNU Lesser General Public
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    16
License along with this library; if not, write to the Free Software
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    17
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    18
"
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    19
"{ Package: 'stx:goodies/smallsense' }"
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    20
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    21
"{ NameSpace: SmallSense }"
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    22
273
404662b42ddf Added AbstractTestCase which saves/restores preferences in setUp/tearDown...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 257
diff changeset
    23
AbstractTestCase subclass:#EditSupportTests
257
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    24
	instanceVariableNames:'codeView codeViewInteractor editService editSupport'
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    25
	classVariableNames:''
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    26
	poolDictionaries:''
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    27
	category:'SmallSense-Tests'
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    28
!
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    29
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    30
!EditSupportTests class methodsFor:'documentation'!
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    31
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    32
copyright
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    33
"
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    34
stx:goodies/smallsense - A productivity plugin for Smalltalk/X IDE
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    35
Copyright (C) 2013-2014 Jan Vrany
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    36
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    37
This library is free software; you can redistribute it and/or
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    38
modify it under the terms of the GNU Lesser General Public
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    39
License as published by the Free Software Foundation; either
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    40
version 2.1 of the License. 
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    41
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    42
This library is distributed in the hope that it will be useful,
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    43
but WITHOUT ANY WARRANTY; without even the implied warranty of
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    44
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    45
Lesser General Public License for more details.
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    46
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    47
You should have received a copy of the GNU Lesser General Public
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    48
License along with this library; if not, write to the Free Software
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    49
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    50
"
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    51
! !
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    52
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    53
!EditSupportTests methodsFor:'accessing-classes'!
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    54
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    55
editSupportClass
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    56
    self subclassResponsibility
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    57
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    58
    "Created: / 23-07-2014 / 07:15:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    59
! !
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    60
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    61
!EditSupportTests methodsFor:'running'!
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    62
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    63
setUp
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    64
    | topView |
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    65
273
404662b42ddf Added AbstractTestCase which saves/restores preferences in setUp/tearDown...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 257
diff changeset
    66
    Smalltalk loadPackage: 'stx:goodies/sunitext/ui'.
404662b42ddf Added AbstractTestCase which saves/restores preferences in setUp/tearDown...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 257
diff changeset
    67
257
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    68
    topView := StandardSystemView new.
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    69
    topView extent: 320 @ 200.
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    70
    topView label: self printString.
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    71
    codeView := Tools::CodeView2 origin: 0.0@0.0 extent: 1.0@1.0 in: topView.
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    72
    codeViewInteractor := codeView interactor.
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    73
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    74
    editService := EditService new.
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    75
    editSupport := self editSupportClass new.
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    76
    codeView services: (Array with: editService).
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    77
    codeView language: editSupport language.
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    78
    editService updateSupport: editSupport.
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    79
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    80
    topView open.
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    81
    topView waitUntilVisible.
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    82
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    83
    "Created: / 23-07-2014 / 07:15:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
273
404662b42ddf Added AbstractTestCase which saves/restores preferences in setUp/tearDown...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 257
diff changeset
    84
    "Modified: / 11-08-2014 / 14:35:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
257
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    85
!
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    86
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    87
tearDown
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    88
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    89
    editService := nil.
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    90
    editSupport := nil.
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    91
    codeView topView destroy.
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    92
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    93
    "Created: / 23-07-2014 / 07:17:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    94
! !
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    95