Sha256: 1e606f1fba88f8132d53f6da0e137e4082b6cc203939456a6dc5922f87978c3e

Contents?: true

Size: 1.02 KB

Versions: 10

Compression:

Stored size: 1.02 KB

Contents

#!/usr/bin/env ruby
require 'test/unit'

# 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

10 entries across 10 versions & 1 rubygems

Version Path
trepanning-2.15.35 test/unit/test-io-tcp.rb
trepanning-1.93.35 test/unit/test-io-tcp.rb
trepanning-2.15.33 test/unit/test-io-tcp.rb
trepanning-1.93.32 test/unit/test-io-tcp.rb
trepanning-0.1.6 test/unit/test-io-tcp.rb
trepanning-0.1.4 test/unit/test-io-tcp.rb
trepanning-0.1.3 test/unit/test-io-tcp.rb
trepanning-0.1.2 test/unit/test-io-tcp.rb
trepanning-0.1.1 test/unit/test-io-tcp.rb
trepanning-0.1.0 test/unit/test-io-tcp.rb