{ my $r = $r( pre_filter => sub { undef } ); is( ref($r->{pre_filter}), 'CODE', 'pre_filter new(n)' ); $r->pre_filter( undef ); ok( !defined $r->{pre_filter}, 'pre_filter(0)' ); } { my $r = $r( filter => sub { undef } ); is( ref($r->{filter}), 'CODE', 'filter new(n)' ); $r->filter( undef ); ok( !defined $r->{filter}, 'filter(0)' ); } */ is($rt->_node_key(['a' => 1, 'b' => 2, 'c' => 3]), 'a', '_node_key(1)'); is($rt->_node_key(['b' => 3, 'c' => 2, 'z' => 1]), 'b', '_node_key(2)'); is($rt->_node_key(['a' => 1, 'a.' => 2, 'b' => 3]), 'a', '_node_key(3)'); is($rt->_node_key(['' => 0, 'a' => 1, 'a.' => 2, 'b' => 3]), 'a', '_node_key(4)'); is($rt->_node_key(['' => 0, 'abc' => 1, 'def' => 2, 'g' => 3]), 'abc', '_node_key(5)'); is($rt->_node_offset(['a', 'b', '\\d+', 'e', '\\d']), -1, '_node_offset(1)'); is($rt->_node_offset([['x' => ['x'], '' => 0], 'a', 'b', '\\d+', 'e', '\\d']), 0, '_node_offset(2)'); is($rt->_node_offset(['a', 'b', '\\d+', 'e', ['a' => 1, 'b' => 2], 'x', 'y', 'z']), 4, '_node_offset(3)'); is($rt->_node_offset([['z' => 1, 'x' => 2], 'b', '\\d+', 'e', ['a' => 1, 'b' => 2], 'z']), 0, '_node_offset(4)'); is($rt->_node_offset([[1, 2, 3, ['a' => ['a'], 'b' => ['b']]], 'a', ['z' => 1, 'x' => 2]]), 2, '_node_offset(5)'); is($rt->_node_eq([], []), 1, '{} eq {}'); is($rt->_node_eq(NULL, []), 0, 'undef ne {}'); is($rt->_node_eq([], NULL), 0, '{} ne undef'); is($rt->_node_eq(NULL, NULL), 0, 'undef ne undef'); is($rt->_node_eq([], []), 1, '[] eq []'); //is( $rt->_node_eq( [], []), 0, '[] ne {}'); //PHPなので同一扱い