RegressionTests__PTYTest.st
author sr
Fri, 15 Sep 2017 13:24:12 +0200
changeset 1700 0c5fa360fd46
parent 1447 2351db93aa5b
child 1703 1d4f44ef3cc9
permissions -rw-r--r--
#BUGFIX by sr class: RegressionTests::PTYTest changed: #testPTY1 #testPTY2

"{ Encoding: utf8 }"

"{ 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 isLinuxLike not
        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
    "
!

testPTY2
    |ptyPair master slave|

    self 
        skipIf:OperatingSystem isLinuxLike not
        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
    "
! !

!PTYTest class methodsFor:'documentation'!

version
    ^ '$Header$'
! !