is(
$inlinable->_inline_check('$foo'),
- 'defined $foo && ! ref $foo && $foo !~ /Q/',
+ '( do { defined $foo && ! ref $foo && $foo !~ /Q/ } )',
'got expected inline code for Inlinable constraint'
);
is(
$aofi->_inline_check('$foo'),
- q{do {my $check = $foo;ref($check) eq "ARRAY" && &List::MoreUtils::all(sub { defined $_ && ! ref $_ && $_ !~ /Q/ }, @{$check})}},
+ q{( do { do {my $check = $foo;ref($check) eq "ARRAY" && &List::MoreUtils::all(sub { ( do { defined $_ && ! ref $_ && $_ !~ /Q/ } ) }, @{$check})} } )},
'got expected inline code for ArrayRef[Inlinable] constraint'
);
is(
$aofi->_inline_check('$foo'),
- q{do {my $check = $foo;ref($check) eq "ARRAY" && &List::MoreUtils::all(sub { defined $_ && ! ref $_ && $_ !~ /Q/ }, @{$check})}},
+ q{( do { do {my $check = $foo;ref($check) eq "ARRAY" && &List::MoreUtils::all(sub { ( do { defined $_ && ! ref $_ && $_ !~ /Q/ } ) }, @{$check})} } )},
'got expected inline code for ArrayOfInlinable constraint'
);
is(
$hoaofi->_inline_check('$foo'),
- q{do {my $check = $foo;ref($check) eq "HASH" && &List::MoreUtils::all(sub { do {my $check = $_;ref($check) eq "ARRAY" && &List::MoreUtils::all(sub { defined $_ && ! ref $_ && $_ !~ /Q/ }, @{$check})} }, values %{$check})}},
+ q{( do { do {my $check = $foo;ref($check) eq "HASH" && &List::MoreUtils::all(sub { ( do { do {my $check = $_;ref($check) eq "ARRAY" && &List::MoreUtils::all(sub { ( do { defined $_ && ! ref $_ && $_ !~ /Q/ } ) }, @{$check})} } ) }, values %{$check})} } )},
'got expected inline code for HashRef[ArrayRef[Inlinable]] constraint'
);
is(
$iunion->_inline_check('$foo'),
- '(defined $foo && ! ref $foo && $foo !~ /Q/) || (Scalar::Util::blessed($foo))',
+ '((( do { defined $foo && ! ref $foo && $foo !~ /Q/ } )) || (( do { Scalar::Util::blessed($foo) } )))',
'got expected inline code for Inlinable | Object constraint'
);
is(
$iunion->_inline_check('$foo'),
- '(Scalar::Util::blessed($foo)) || (defined $foo && ! ref $foo && $foo !~ /Q/)',
+ '((( do { Scalar::Util::blessed($foo) } )) || (( do { defined $foo && ! ref $foo && $foo !~ /Q/ } )))',
'got expected inline code for Object | Inlinable constraint'
);
is(
$iunion->_inline_check('$foo'),
- q{(Scalar::Util::blessed($foo)) || (defined $foo && ! ref $foo && $foo !~ /Q/) || (ref($foo) eq "CODE")},
+ q{((( do { Scalar::Util::blessed($foo) } )) || (( do { defined $foo && ! ref $foo && $foo !~ /Q/ } )) || (( do { ref($foo) eq "CODE" } )))},
'got expected inline code for Object | Inlinable | CodeRef constraint'
);