/[cwmp]/google/trunk/t/07-tree.t
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /google/trunk/t/07-tree.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 103 - (hide annotations)
Sun Jun 24 19:36:31 2007 UTC (17 years ago) by dpavlin
Original Path: google/t/07-tree.t
File MIME type: application/x-troff
File size: 940 byte(s)
Extracted tree generating perl code to CWMP::Tree
1 dpavlin 103 #!/usr/bin/perl
2     use strict;
3     use warnings;
4    
5     my $debug = shift @ARGV;
6    
7     use Test::More tests => 6;
8     use Data::Dump qw/dump/;
9     use lib 'lib';
10    
11     BEGIN {
12     use_ok('CWMP::Tree');
13     }
14    
15     #use Cwd qw/abs_path/;
16     #ok(my $abs_path = abs_path($0), "abs_path");
17     #$abs_path =~ s!/[^/]*$!/!; #!fix-vim
18    
19     ok( my $obj = CWMP::Tree->new({
20     debug => $debug,
21     }), 'new' );
22     isa_ok( $obj, 'CWMP::Tree' );
23    
24     my @perl = qw/
25     {'InternetGatewayDevice'}->{'DeviceInfo'}->{'HardwareVersion'}
26     {'InternetGatewayDevice'}->{'DeviceInfo'}->{'VendorConfigFile'}->[1]->{'Date'}
27     {'InternetGatewayDevice'}->{'Services'}->{'VoiceService'}->[1]->{'PhyInterface'}->[2]->{'PhyPort'}
28     /;
29    
30     foreach my $name ( qw/
31     InternetGatewayDevice.DeviceInfo.HardwareVersion
32     InternetGatewayDevice.DeviceInfo.VendorConfigFile.1.Date
33     InternetGatewayDevice.Services.VoiceService.1.PhyInterface.2.PhyPort
34     / ) {
35     my $expect = shift @perl;
36     cmp_ok( $obj->name2perl( $name ), 'eq', $expect, "name2perl( $name )" );
37     }

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26