Annotation of trango/Net-Telnet-Trango/t/31-decode-linktest.t, Revision 1.1
1.1 ! andrew 1: #!perl -T
! 2: # $RedRiver$
! 3:
! 4: use Test::More tests => 3;
! 5: use File::Spec;
! 6:
! 7: BEGIN {
! 8: use_ok( 'Net::Telnet::Trango' );
! 9: }
! 10:
! 11: diag("25: Parse linktest");
! 12:
! 13: my $linktest = <<'EOL';
! 14: [suid] 5 [pkt len] 1600 bytes [# of pkts per cycle] 500 [cycle] 5
! 15:
! 16: 0 [AP Tx] 500 [AP Rx] 500 [AP RxErr] 0 [SU Tx] 500 [SU Rx] 500 [SU RxErr] 0 1286 ms 9953 kbps
! 17: 1 [AP Tx] 500 [AP Rx] 500 [AP RxErr] 0 [SU Tx] 500 [SU Rx] 500 [SU RxErr] 0 1287 ms 9945 kbps
! 18: 2 [AP Tx] 500 [AP Rx] 500 [AP RxErr] 0 [SU Tx] 500 [SU Rx] 500 [SU RxErr] 0 1288 ms 9937 kbps
! 19: 3 [AP Tx] 500 [AP Rx] 500 [AP RxErr] 0 [SU Tx] 500 [SU Rx] 500 [SU RxErr] 0 1287 ms 9945 kbps
! 20: 4 [AP Tx] 500 [AP Rx] 500 [AP RxErr] 0 [SU Tx] 500 [SU Rx] 500 [SU RxErr] 0 1288 ms 9937 kbps
! 21:
! 22: [AP Total nTx] 5000 pkts
! 23: [AP Total nRx] 5000 pkts
! 24: [AP Total nRxErr] 0 pkts
! 25:
! 26: [SU Total nTx] 5000 pkts
! 27: [SU Total nRx] 5000 pkts
! 28: [SU Total nRxErr] 0 pkts
! 29:
! 30: [AP to SU Error Rate] 0.00 %
! 31: [SU to AP Error Rate] 0.00 %
! 32:
! 33: [Avg of Throughput] 9942 kbps
! 34: EOL
! 35:
! 36: $should_decode_to = {
! 37: 'tests' => [
! 38: {
! 39: 'SU Tx' => '500',
! 40: 'SU RxErr' => '0 1286 ms 9953 kbps',
! 41: 'SU Rx' => '500',
! 42: 'AP Rx' => '500',
! 43: 'AP RxErr' => '0',
! 44: 'AP Tx' => '500'
! 45: },
! 46: {
! 47: 'SU Tx' => '500',
! 48: 'SU RxErr' => '0 1287 ms 9945 kbps',
! 49: 'SU Rx' => '500',
! 50: 'AP Rx' => '500',
! 51: 'AP RxErr' => '0',
! 52: 'AP Tx' => '500'
! 53: },
! 54: {
! 55: 'SU Tx' => '500',
! 56: 'SU RxErr' => '0 1288 ms 9937 kbps',
! 57: 'SU Rx' => '500',
! 58: 'AP Rx' => '500',
! 59: 'AP RxErr' => '0',
! 60: 'AP Tx' => '500'
! 61: },
! 62: {
! 63: 'SU Tx' => '500',
! 64: 'SU RxErr' => '0 1287 ms 9945 kbps',
! 65: 'SU Rx' => '500',
! 66: 'AP Rx' => '500',
! 67: 'AP RxErr' => '0',
! 68: 'AP Tx' => '500'
! 69: },
! 70: {
! 71: 'SU Tx' => '500',
! 72: 'SU RxErr' => '0 1288 ms 9937 kbps',
! 73: 'SU Rx' => '500',
! 74: 'AP Rx' => '500',
! 75: 'AP RxErr' => '0',
! 76: 'AP Tx' => '500'
! 77: }
! 78: ],
! 79: 'AP Total nTx' => '5000 pkts',
! 80: 'AP Total nRxErr' => '0 pkts',
! 81: '# of pkts per cycle' => '500',
! 82: 'AP Total nRx' => '5000 pkts',
! 83: 'SU Total nRxErr' => '0 pkts',
! 84: 'SU to AP Error Rate' => '0.00 %',
! 85: 'AP to SU Error Rate' => '0.00 %',
! 86: 'suid' => '5',
! 87: 'SU Total nRx' => '5000 pkts',
! 88: 'SU Total nTx' => '5000 pkts',
! 89: 'Avg of Throughput' => '9942 kbps',
! 90: 'pkt len' => '1600 bytes',
! 91: 'cycle' => '5'
! 92: };
! 93:
! 94: my @linktest = split /\n/, $linktest;
! 95:
! 96: my $decoded;
! 97: ok($decoded = Net::Telnet::Trango::_decode_linktest(@linktest),
! 98: "Decoding linktest");
! 99:
! 100: is_deeply($decoded, $should_decode_to, "Decoded information matches");
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>