author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Wed, 31 May 2017 10:16:42 +0100 | |
branch | jv |
changeset 1605 | 5ff1befbd463 |
parent 1500 | d406a10b2965 |
child 1974 | f2eaf05205d6 |
permissions | -rw-r--r-- |
1447 | 1 |
"{ Package: 'stx:goodies/regression' }" |
182 | 2 |
|
3 |
"{ NameSpace: RegressionTests }" |
|
4 |
||
5 |
TestCase subclass:#PTYTest |
|
6 |
instanceVariableNames:'' |
|
7 |
classVariableNames:'' |
|
1605
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
8 |
poolDictionaries:'TTYConstants' |
1081 | 9 |
category:'tests-Regression-Streams' |
182 | 10 |
! |
11 |
||
12 |
||
1605
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
13 |
!PTYTest methodsFor:'running'! |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
14 |
|
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
15 |
setUp |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
16 |
self skipIf: OperatingSystem supportsTTYs not description: 'No TTY / PTY support' |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
17 |
|
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
18 |
"Created: / 01-06-2017 / 21:25:55 / jv" |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
19 |
! ! |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
20 |
|
182 | 21 |
!PTYTest methodsFor:'tests'! |
22 |
||
1605
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
23 |
testEOLMode01 |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
24 |
|ptyPair master slave data | |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
25 |
|
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
26 |
ptyPair := NonPositionableExternalStream makePTYPair. |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
27 |
master := ptyPair at:1. |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
28 |
slave := ptyPair at:2. |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
29 |
|
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
30 |
master nextPutLine:'1234'. |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
31 |
master nextPutLine:'ABCD'. |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
32 |
|
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
33 |
self assert:(data := slave nextLine) = '1234'. |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
34 |
self assert:(data := master nextLine) = '1234'. |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
35 |
|
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
36 |
self assert:(data := slave nextLine) = 'ABCD'. |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
37 |
self assert:(data := master nextLine) = 'ABCD'. |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
38 |
|
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
39 |
master close. |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
40 |
slave close. |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
41 |
|
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
42 |
"Created: / 31-05-2017 / 09:52:46 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
43 |
"Modified (comment): / 31-05-2017 / 11:35:41 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
44 |
! |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
45 |
|
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
46 |
testEOLMode02 |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
47 |
" |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
48 |
Turn off CR-LF on PTY (i.e., make sure lines are NL only) |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
49 |
" |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
50 |
|ptyPair master slave data attrs | |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
51 |
|
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
52 |
ptyPair := NonPositionableExternalStream makePTYPair. |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
53 |
master := ptyPair at:1. |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
54 |
slave := ptyPair at:2. |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
55 |
|
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
56 |
attrs := master getTTYAttributes. |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
57 |
attrs c_oflag: (attrs c_oflag bitClear: ONLCR). |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
58 |
master setTTYAttributes: attrs. |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
59 |
|
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
60 |
|
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
61 |
master nextPutLine:'1234'. |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
62 |
master nextPutLine:'ABCD'. |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
63 |
|
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
64 |
self assert:(data := slave next:4) = '1234'. |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
65 |
self assert:(data := master next:4) = '1234'. |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
66 |
|
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
67 |
self assert: (data := slave next) == Character linefeed. |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
68 |
self assert: (data := master next) == Character linefeed. |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
69 |
|
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
70 |
self assert: (data := slave next: 4) = 'ABCD'. |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
71 |
self assert: (data := master next: 4) = 'ABCD'. |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
72 |
|
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
73 |
master close. |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
74 |
slave close. |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
75 |
|
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
76 |
"Created: / 31-05-2017 / 09:53:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
77 |
"Modified: / 31-05-2017 / 15:29:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
78 |
"Modified: / 01-06-2017 / 21:23:35 / jv" |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
79 |
! |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
80 |
|
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
81 |
testEchoOff |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
82 |
|ptyPair master slave attrs data | |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
83 |
|
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
84 |
ptyPair := NonPositionableExternalStream makePTYPair. |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
85 |
master := ptyPair at:1. |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
86 |
slave := ptyPair at:2. |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
87 |
|
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
88 |
attrs := master getTTYAttributes. |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
89 |
attrs c_lflag: attrs c_lflag | ECHO. |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
90 |
master setTTYAttributes: attrs. |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
91 |
|
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
92 |
master nextPutLine:'1234567890'. |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
93 |
self assert:(data := slave nextLine) = '1234567890'. |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
94 |
self assert:(data := master nextAvailable:10+1"CR"+1"NL") notEmpty. |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
95 |
|
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
96 |
attrs := master getTTYAttributes. |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
97 |
attrs c_lflag: (attrs c_lflag bitClear: ECHO). |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
98 |
master setTTYAttributes: attrs. |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
99 |
|
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
100 |
master nextPutLine:'1234567890'. |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
101 |
self assert:(data := slave nextLine) = '1234567890'. |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
102 |
self assert:(data := master nextAvailable: 11) isEmpty. |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
103 |
|
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
104 |
|
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
105 |
|
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
106 |
|
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
107 |
master close. |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
108 |
slave close. |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
109 |
|
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
110 |
"Created: / 31-05-2017 / 07:41:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
111 |
"Modified: / 31-05-2017 / 08:46:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
112 |
"Modified: / 01-06-2017 / 21:23:55 / jv" |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
113 |
! |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
114 |
|
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
115 |
testGetSetAttributes |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
116 |
|ptyPair master slave attrs | |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
117 |
|
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
118 |
ptyPair := NonPositionableExternalStream makePTYPair. |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
119 |
master := ptyPair at:1. |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
120 |
slave := ptyPair at:2. |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
121 |
|
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
122 |
attrs := master getTTYAttributes. |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
123 |
master setTTYAttributes: attrs. |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
124 |
|
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
125 |
attrs := slave getTTYAttributes. |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
126 |
slave setTTYAttributes: attrs. |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
127 |
|
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
128 |
|
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
129 |
master close. |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
130 |
slave close. |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
131 |
|
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
132 |
"Created: / 31-05-2017 / 07:39:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
133 |
"Modified: / 01-06-2017 / 21:24:09 / jv" |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
134 |
! |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
135 |
|
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
136 |
testIsTTY |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
137 |
|ptyPair master slave| |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
138 |
|
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
139 |
ptyPair := NonPositionableExternalStream makePTYPair. |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
140 |
master := ptyPair at:1. |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
141 |
slave := ptyPair at:2. |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
142 |
|
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
143 |
self assert: master isTTY. |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
144 |
self assert: slave isTTY. |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
145 |
|
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
146 |
master close. |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
147 |
slave close. |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
148 |
|
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
149 |
"Created: / 31-05-2017 / 07:38:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
150 |
! |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
151 |
|
182 | 152 |
testPTY1 |
153 |
|ptyPair master slave| |
|
154 |
||
674 | 155 |
ptyPair := NonPositionableExternalStream makePTYPair. |
182 | 156 |
master := ptyPair at:1. |
157 |
slave := ptyPair at:2. |
|
158 |
||
159 |
master nextPutLine:'1234567890'. |
|
183 | 160 |
'1234567890' do:[:ch | |
1447 | 161 |
self assert:(slave next = ch). |
183 | 162 |
]. |
163 |
self assert:(slave next = Character linefeed). |
|
164 |
||
165 |
master close. |
|
166 |
slave close. |
|
167 |
||
168 |
" |
|
169 |
self new testPTY1 |
|
170 |
" |
|
171 |
! |
|
172 |
||
173 |
testPTY2 |
|
174 |
|ptyPair master slave| |
|
175 |
||
674 | 176 |
ptyPair := NonPositionableExternalStream makePTYPair. |
183 | 177 |
master := ptyPair at:1. |
178 |
slave := ptyPair at:2. |
|
179 |
||
180 |
master nextPutLine:'1234567890'. |
|
182 | 181 |
self assert:(slave nextLine = '1234567890'). |
182 |
||
183 |
slave nextPutLine:'1234567890'. |
|
184 |
self assert:(master nextLine = '1234567890'). |
|
185 |
||
186 |
master close. |
|
187 |
slave close. |
|
188 |
||
189 |
" |
|
183 | 190 |
self new testPTY2 |
182 | 191 |
" |
192 |
! ! |
|
193 |
||
194 |
!PTYTest class methodsFor:'documentation'! |
|
195 |
||
196 |
version |
|
197 |
^ '$Header$' |
|
1605
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
198 |
! |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
199 |
|
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
200 |
version_HG |
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
201 |
|
5ff1befbd463
Added tests for (UNIX) TTY / PTY attribute support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
202 |
^ '$Changeset: <not expanded> $' |
182 | 203 |
! ! |
1081 | 204 |