Sha256: 30262a0476804bba07fb714b6c5ca204ce7f4144907696f2f228ee8c781c2cb8

Contents?: true

Size: 1.07 KB

Versions: 15

Compression:

Stored size: 1.07 KB

Contents

#!/usr/bin/env ruby
require 'test/unit'
require 'rubygems'; require 'require_relative'

# Unit test for io/tcpclient.rb and io/tcpserver.rb together
require_relative '../../io/tcpfns'
require_relative '../../io/tcpclient'
require_relative '../../io/tcpserver'

# Tests TCPServer together with and TCPClient
class TestTCPClientServer < Test::Unit::TestCase

  def test_client_server
    server = Trepan::TCPDbgServer.new({ :open => true,
                                        :port => 1028,
                                        :host => 'localhost'
                                      })
    client = Trepan::TCPDbgClient.new({ :open => true,
                                        :port => 1028,
                                        :host => 'localhost'
                                      })
    %w(one, two, three).each do |line|
      server.writeline(line)
      assert_equal line, client.read_msg.chomp
    end
    %w(four, five, six).each do |line|
      client.writeline(line)
      assert_equal line, server.read_msg.chomp
    end
    client.close
    server.close
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
rbx-trepanning-0.2.1-universal-rubinius-2.0 test/unit/test-io-tcp.rb
rbx-trepanning-0.2.1-universal-rubinius-1.2 test/unit/test-io-tcp.rb
rbx-trepanning-0.2.0-universal-rubinius-2.0 test/unit/test-io-tcp.rb
rb8-trepanning-0.1.6 test/unit/test-io-tcp.rb
rb8-trepanning-0.1.5 test/unit/test-io-tcp.rb
rbx-trepanning-0.1.0-universal-rubinius-1.2 test/unit/test-io-tcp.rb
rb8-trepanning-0.1.4 test/unit/test-io-tcp.rb
rb8-trepanning-0.1.3 test/unit/test-io-tcp.rb
rb8-trepanning-0.1.3-universal-ruby-1.9.2 test/unit/test-io-tcp.rb
rb8-trepanning-0.1.3-universal-ruby-1.8.7 test/unit/test-io-tcp.rb
rbx-trepanning-0.0.8-universal-rubinius-1.2 test/unit/test-io-tcp.rb
rbx-trepanning-0.0.7-universal-rubinius-1.2 test/unit/test-io-tcp.rb
rbx-trepanning-0.0.6-universal-rubinius-1.2 test/unit/test-io-tcp.rb
rbx-trepanning-0.0.5-universal-rubinius-1.2.1 test/unit/test-io-tcp.rb
rbx-trepanning-0.0.4-universal-rubinius-1.2 test/unit/test-io-tcp.rb