1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
|
# -*- mode: Perl -*-
BEGIN { unshift @INC, "lib" }
use strict;
use FileHandle;
use SNMP::MIB::Compiler;
use Data::Compare;
local $^W = 1;
$| = 1;
print "1..1\n";
my $t = 1;
my $mib = new SNMP::MIB::Compiler();
$mib->{'filename'} = '<DATA>';
$mib->{'debug_lexer'} = 0;
$mib->{'allow_underscore'} = 1;
# create a stream to the pseudo MIB file
my $s = Stream->new(*DATA);
$mib->{'stream'} = $s;
$mib->parse_Module;
my $good = { 1 => 'noUnderscore', 2 => 'with_underscore' };
print Compare($mib->{'nodes'}{'underScore'}{'syntax'}{'values'},
$good) ? "" : "not ", "ok ", $t++, "\n";
# end
__DATA__
UNDERSCORE-MIB DEFINITIONS ::= BEGIN
underScore OBJECT-TYPE
SYNTAX INTEGER {
noUnderscore(1),
with_underscore(2)
}
ACCESS read-only
STATUS mandatory
DESCRIPTION
" "
::= { under 1 }
END
|