RegressionTests__PTYTest.st
author Stefan Vogel <sv@exept.de>
Tue, 11 Jun 2019 10:34:41 +0200
changeset 2321 32ea6329f5ad
parent 1703 1d4f44ef3cc9
permissions -rw-r--r--
class: stx_goodies_regression class changed: #classNamesAndAttributes make classes autoloaded that stc cannot compile (yet)

"{ Package: 'stx:goodies/regression' }"

"{ NameSpace: RegressionTests }"

TestCase subclass:#PTYTest
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'tests-Regression-Streams'
!


!PTYTest methodsFor:'tests'!

testPTY1
    |ptyPair master slave|

    self
        skipIf:OperatingSystem isMSDOSlike
        description:'#makePTYPair not implemented in Win32OperatingSystem'.

    ptyPair := NonPositionableExternalStream makePTYPair.
    master := ptyPair at:1.
    slave := ptyPair at:2.

    master nextPutLine:'1234567890'.
    '1234567890' do:[:ch |
        self assert:(slave next = ch).
    ].
    self assert:(slave next = Character linefeed).

    master close.
    slave close.

    "
     self new testPTY1
    "

    "Modified: / 18-09-2017 / 11:51:21 / mawalch"
!

testPTY2
    |ptyPair master slave|

    self
        skipIf:OperatingSystem isMSDOSlike
        description:'#makePTYPair not implemented in Win32OperatingSystem'.

    ptyPair := NonPositionableExternalStream makePTYPair.
    master := ptyPair at:1.
    slave := ptyPair at:2.

    master nextPutLine:'1234567890'.
    self assert:(slave nextLine = '1234567890').

    slave nextPutLine:'1234567890'.
    self assert:(master nextLine = '1234567890').

    master close.
    slave close.

    "
     self new testPTY2
    "

    "Modified: / 18-09-2017 / 11:51:48 / mawalch"
! !

!PTYTest class methodsFor:'documentation'!

version
    ^ '$Header$'
! !