RegressionTests__PTYTest.st
author sr
Mon, 18 Sep 2017 11:50:50 +0200
changeset 1701 48849326905a
parent 1700 0c5fa360fd46
child 1703 1d4f44ef3cc9
permissions -rw-r--r--
#BUGFIX by sr class: RegressionTests::OperationInQueueTests changed: #test incremented the time range... because the test did fail sometime, may due to tide timinings

"{ 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$'
! !