SmallSense__EditSupportTests.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Sat, 07 Mar 2015 10:53:11 +0000
changeset 447 2d45c613a5bd
parent 444 a47f43af21d6
child 1056 7bcadc51aad8
permissions -rw-r--r--
Completion: fix in Smalltalk completion - include last double colon for keyword selectors Due to a bug in MethodPO, double colon was not inserted after l;ast keyword. This commit fixes the bug and includes a test for it.
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
374
e65bd2bf892a Updated copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 273
diff changeset
     3
Copyright (C) 2013-2015 Jan Vrany
257
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
374
e65bd2bf892a Updated copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 273
diff changeset
    35
Copyright (C) 2013-2015 Jan Vrany
257
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
444
a47f43af21d6 Smalltalk electric snippets: make iterator variable naming logic more configurable
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 374
diff changeset
    66
    super setUp.
a47f43af21d6 Smalltalk electric snippets: make iterator variable naming logic more configurable
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 374
diff changeset
    67
273
404662b42ddf Added AbstractTestCase which saves/restores preferences in setUp/tearDown...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 257
diff changeset
    68
    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
    69
257
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    70
    topView := StandardSystemView new.
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    71
    topView extent: 320 @ 200.
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    72
    topView label: self printString.
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    73
    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
    74
    codeViewInteractor := codeView interactor.
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    75
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    76
    editService := EditService new.
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    77
    editSupport := self editSupportClass new.
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    78
    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
    79
    codeView language: editSupport language.
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    80
    editService updateSupport: editSupport.
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    81
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    82
    topView open.
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    83
    topView waitUntilVisible.
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    84
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    85
    "Created: / 23-07-2014 / 07:15:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
444
a47f43af21d6 Smalltalk electric snippets: make iterator variable naming logic more configurable
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 374
diff changeset
    86
    "Modified (format): / 04-03-2015 / 09:42:45 / 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
    87
!
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
tearDown
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    90
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    91
    editService := nil.
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    92
    editSupport := nil.
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    93
    codeView topView destroy.
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    94
444
a47f43af21d6 Smalltalk electric snippets: make iterator variable naming logic more configurable
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 374
diff changeset
    95
    super tearDown
a47f43af21d6 Smalltalk electric snippets: make iterator variable naming logic more configurable
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 374
diff changeset
    96
257
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    97
    "Created: / 23-07-2014 / 07:17:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
444
a47f43af21d6 Smalltalk electric snippets: make iterator variable naming logic more configurable
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 374
diff changeset
    98
    "Modified: / 04-03-2015 / 09:43:16 / 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
    99
! !
623cefc35e2e Fix for DNU when indent-on-paste is enabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   100
444
a47f43af21d6 Smalltalk electric snippets: make iterator variable naming logic more configurable
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 374
diff changeset
   101
!EditSupportTests class methodsFor:'documentation'!
a47f43af21d6 Smalltalk electric snippets: make iterator variable naming logic more configurable
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 374
diff changeset
   102
a47f43af21d6 Smalltalk electric snippets: make iterator variable naming logic more configurable
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 374
diff changeset
   103
version_HG
a47f43af21d6 Smalltalk electric snippets: make iterator variable naming logic more configurable
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 374
diff changeset
   104
a47f43af21d6 Smalltalk electric snippets: make iterator variable naming logic more configurable
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 374
diff changeset
   105
    ^ '$Changeset: <not expanded> $'
a47f43af21d6 Smalltalk electric snippets: make iterator variable naming logic more configurable
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 374
diff changeset
   106
! !
a47f43af21d6 Smalltalk electric snippets: make iterator variable naming logic more configurable
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 374
diff changeset
   107