tests/VDBSimpleConsoleViewTest.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Wed, 13 Mar 2019 14:07:49 +0000
changeset 149 adaffe052a41
parent 143 df7f89efd39d
child 170 cd9615ebe6a9
permissions -rw-r--r--
Show log output in simple console This needed because, for example, python errors and stacktrace is reported on log stream, not on output stream.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
132
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     1
"
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     2
jv:vdb - Visual / VM Debugger
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     3
Copyright (C) 2015-now Jan Vrany
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     4
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     5
This software is licensed under 'Creative Commons Attribution-NonCommercial 4.0 International License'
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     6
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     7
You may find a full license text in LICENSE.txt or at http://creativecommons.org/licenses/by-nc/4.0/
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     8
"
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     9
"{ Package: 'jv:vdb/tests' }"
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    10
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    11
"{ NameSpace: Smalltalk }"
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    12
143
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
    13
TestCase subclass:#VDBSimpleConsoleViewTest
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
    14
	instanceVariableNames:'preferences console consoleI'
132
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    15
	classVariableNames:''
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    16
	poolDictionaries:''
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    17
	category:'VDB-UI-Console-Tests'
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    18
!
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    19
143
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
    20
!VDBSimpleConsoleViewTest class methodsFor:'documentation'!
132
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    21
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    22
copyright
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    23
"
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    24
jv:vdb - Visual / VM Debugger
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    25
Copyright (C) 2015-now Jan Vrany
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    26
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    27
This software is licensed under 'Creative Commons Attribution-NonCommercial 4.0 International License'
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    28
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    29
You may find a full license text in LICENSE.txt or at http://creativecommons.org/licenses/by-nc/4.0/
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    30
"
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    31
! !
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    32
143
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
    33
!VDBSimpleConsoleViewTest methodsFor:'running'!
132
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    34
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    35
setUp
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    36
    | window |
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    37
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    38
    super setUp.
143
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
    39
    Screen current isNil ifTrue:[
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
    40
        Smalltalk openDisplay
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
    41
    ].
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
    42
    self skipIf:Screen current isNil description:'No display connection'.
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
    43
    Smalltalk loadPackage:'stx:goodies/sunit/ext/ui'.
132
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    44
    window := StandardSystemView new.
143
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
    45
    window extent:320 @ 200.
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
    46
    window label:self printString.
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
    47
    console := VDBSimpleConsoleView 
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
    48
            origin:0.0 @ 0.0
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
    49
            extent:1.0 @ 1.0
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
    50
            in:window.
132
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    51
    window open.
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    52
    window waitUntilVisible.
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    53
    consoleI := console interactor
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    54
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    55
    "Modified: / 16-01-2019 / 10:24:12 / jv"
143
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
    56
    "Modified: / 25-01-2019 / 09:34:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
132
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    57
!
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    58
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    59
tearDown
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    60
    super tearDown.
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    61
    console topView destroy.
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    62
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    63
    "Created: / 28-09-2018 / 08:29:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    64
    "Modified: / 16-01-2019 / 16:23:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    65
! !
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    66
143
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
    67
!VDBSimpleConsoleViewTest methodsFor:'tests - basic'!
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
    68
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
    69
test_basic_01
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
    70
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
    71
    console show: '(gdb) '.
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
    72
    self assert: console list first = '(gdb) '.
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
    73
    self assert: console cursorCol = 7.
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
    74
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
    75
    consoleI type: 'b main'.
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
    76
    self assert: console list first = '(gdb) b main'.
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
    77
    self assert: console cursorCol = 13.
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
    78
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
    79
    consoleI type: #BackSpace.
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
    80
    self assert: console list first = '(gdb) b mai'.
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
    81
    self assert: console cursorCol = 12.
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
    82
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
    83
    consoleI type: #CursorLeft.
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
    84
    self assert: console list first = '(gdb) b mai'.
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
    85
    self assert: console cursorCol = 11.
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
    86
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
    87
    consoleI type: 'x'.
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
    88
    self assert: console list first = '(gdb) b maxi'.
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
    89
    self assert: console cursorCol = 12.
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
    90
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
    91
    consoleI type: #Delete.
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
    92
    self assert: console list first = '(gdb) b max'.
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
    93
    self assert: console cursorCol = 12.
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
    94
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
    95
    consoleI type: #CursorRight.
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
    96
    self assert: console list first = '(gdb) b max'.
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
    97
    self assert: console cursorCol = 12.
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
    98
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
    99
    consoleI type: #BeginOfLine.
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
   100
    self assert: console list first = '(gdb) b max'.
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
   101
    self assert: console cursorCol = 7.
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
   102
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
   103
    consoleI type: #CursorRight.
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
   104
    self assert: console list first = '(gdb) b max'.
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
   105
    self assert: console cursorCol = 8.
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
   106
    
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
   107
    consoleI type: 'r'.
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
   108
    self assert: console list first = '(gdb) br max'.
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
   109
    self assert: console cursorCol = 9.
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
   110
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
   111
    consoleI type: #EndOfLine.
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
   112
    self assert: console list first = '(gdb) br max'.
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
   113
    self assert: console cursorCol = 13.
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
   114
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
   115
    consoleI type: '('.
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
   116
    self assert: console list first = '(gdb) br max('.
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
   117
    self assert: console cursorCol = 14.
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
   118
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
   119
    "Created: / 25-01-2019 / 09:37:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
   120
    "Modified: / 25-01-2019 / 11:42:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
   121
! !
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
   122
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
   123
!VDBSimpleConsoleViewTest methodsFor:'tests - obsolete'!
132
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   124
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   125
test_completion_01
143
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
   126
    console completeAction:[ :partial | 
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
   127
        console completions: #('finish')
132
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   128
    ].
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   129
    consoleI type: 'fi'.
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   130
    consoleI type: #Tab.
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   131
    self assert: console list first asString = 'finish'.
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   132
143
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
   133
    "Created: / 25-01-2019 / 22:47:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
132
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   134
!
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   135
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   136
test_completion_02
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   137
143
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
   138
    console completeAction:[ :partial | 
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
   139
        console completions:     
132
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   140
            (#('file' 'finish') select: [ :each | each startsWith: partial ]).
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   141
    ].
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   142
    consoleI type: 'f'.
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   143
    consoleI type: #Tab.
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   144
    self assert: console list first asString = 'fi'.
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   145
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   146
    consoleI type: 'l'.
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   147
    consoleI type: #Tab.
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   148
    self assert: console list first asString = 'file'.
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   149
143
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
   150
    "Created: / 25-01-2019 / 22:48:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
132
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   151
!
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   152
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   153
test_completion_03
143
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
   154
    console show: '-> '.
132
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   155
143
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
   156
    console completeAction:[ :partial | 
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
   157
        console completions:     
132
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   158
            (#('file' 'finish') select: [ :each | each startsWith: partial ]).
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   159
    ].
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   160
    consoleI type: 'f'.
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   161
    consoleI type: #Tab.
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   162
    consoleI type: #Tab.
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   163
    self assert: (console list at: 1) asString = '-> fi'.
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   164
    self assert: (console list at: 2) asString = 'file'.
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   165
    self assert: (console list at: 3) asString = 'finish'.
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   166
    self assert: (console list at: 4) asString = '-> fi'.
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   167
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   168
    consoleI type: 'n'.
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   169
    consoleI type: #Tab.
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   170
    self assert: (console list at: 4) asString = '-> finish'.
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   171
143
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
   172
    "Created: / 25-01-2019 / 22:48:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
132
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   173
! !
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   174
143
df7f89efd39d A complete rewrite of simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 132
diff changeset
   175
!VDBSimpleConsoleViewTest class methodsFor:'documentation'!
132
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   176
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   177
version_HG
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   178
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   179
    ^ '$Changeset: <not expanded> $'
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   180
! !
a1dededebc0b UX: add initial support for command completion in simple console
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   181