{
ok(
- $inlinable->has_inlined_type_constraint,
- 'Inlinable returns true for has_inlined_type_constraint'
+ $inlinable->can_be_inlined,
+ 'Inlinable returns true for can_be_inlined'
);
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'
);
ok(
- !$not_inlinable->has_inlined_type_constraint,
- 'NotInlinable returns false for has_inlined_type_constraint'
+ !$not_inlinable->can_be_inlined,
+ 'NotInlinable returns false for can_be_inlined'
);
like(
'ArrayRef[Inlinable]');
ok(
- $aofi->has_inlined_type_constraint,
- 'ArrayRef[Inlinable] returns true for has_inlined_type_constraint'
+ $aofi->can_be_inlined,
+ 'ArrayRef[Inlinable] returns true for can_be_inlined'
);
is(
$aofi->_inline_check('$foo'),
- q{ref($foo) eq "ARRAY" && &List::MoreUtils::all(sub { defined $_ && ! ref $_ && $_ !~ /Q/ }, @{$foo})},
+ 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'
);
'ArrayRef[NotInlinable]');
ok(
- !$aofni->has_inlined_type_constraint,
- 'ArrayRef[NotInlinable] returns false for has_inlined_type_constraint'
+ !$aofni->can_be_inlined,
+ 'ArrayRef[NotInlinable] returns false for can_be_inlined'
);
}
'ArrayOfInlinable');
ok(
- $aofi->has_inlined_type_constraint,
- 'ArrayOfInlinable returns true for has_inlined_type_constraint'
+ $aofi->can_be_inlined,
+ 'ArrayOfInlinable returns true for can_be_inlined'
);
is(
$aofi->_inline_check('$foo'),
- q{ref($foo) eq "ARRAY" && &List::MoreUtils::all(sub { defined $_ && ! ref $_ && $_ !~ /Q/ }, @{$foo})},
+ 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'
);
'ArrayOfNotInlinable');
ok(
- !$aofni->has_inlined_type_constraint,
- 'ArrayOfNotInlinable returns false for has_inlined_type_constraint'
+ !$aofni->can_be_inlined,
+ 'ArrayOfNotInlinable returns false for can_be_inlined'
);
}
'HashRef[ArrayRef[Inlinable]]');
ok(
- $hoaofi->has_inlined_type_constraint,
- 'HashRef[ArrayRef[Inlinable]] returns true for has_inlined_type_constraint'
+ $hoaofi->can_be_inlined,
+ 'HashRef[ArrayRef[Inlinable]] returns true for can_be_inlined'
);
is(
$hoaofi->_inline_check('$foo'),
- q{ref($foo) eq "HASH" && &List::MoreUtils::all(sub { ref($_) eq "ARRAY" && &List::MoreUtils::all(sub { defined $_ && ! ref $_ && $_ !~ /Q/ }, @{$_}) }, values %{$foo})},
+ 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'
);
'HashRef[ArrayRef[NotInlinable]]');
ok(
- !$hoaofni->has_inlined_type_constraint,
- 'HashRef[ArrayRef[NotInlinable]] returns false for has_inlined_type_constraint'
+ !$hoaofni->can_be_inlined,
+ 'HashRef[ArrayRef[NotInlinable]] returns false for can_be_inlined'
);
}
'Inlinable | Object');
ok(
- $iunion->has_inlined_type_constraint,
- 'Inlinable | Object returns true for has_inlined_type_constraint'
+ $iunion->can_be_inlined,
+ 'Inlinable | Object returns true for can_be_inlined'
);
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'
);
'NotInlinable | Object');
ok(
- !$niunion->has_inlined_type_constraint,
- 'NotInlinable | Object returns false for has_inlined_type_constraint'
+ !$niunion->can_be_inlined,
+ 'NotInlinable | Object returns false for can_be_inlined'
);
}
'Object | Inlinable');
ok(
- $iunion->has_inlined_type_constraint,
- 'Object | Inlinable returns true for has_inlined_type_constraint'
+ $iunion->can_be_inlined,
+ 'Object | Inlinable returns true for can_be_inlined'
);
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'
);
'Object | NotInlinable');
ok(
- !$niunion->has_inlined_type_constraint,
- 'Object | NotInlinable returns false for has_inlined_type_constraint'
+ !$niunion->can_be_inlined,
+ 'Object | NotInlinable returns false for can_be_inlined'
);
}
'Object | Inlinable | CodeRef');
ok(
- $iunion->has_inlined_type_constraint,
- 'Object | Inlinable | CodeRef returns true for has_inlined_type_constraint'
+ $iunion->can_be_inlined,
+ 'Object | Inlinable | CodeRef returns true for can_be_inlined'
);
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'
);
'Object | NotInlinable | CodeRef');
ok(
- !$niunion->has_inlined_type_constraint,
- 'Object | NotInlinable | CodeRef returns false for has_inlined_type_constraint'
+ !$niunion->can_be_inlined,
+ 'Object | NotInlinable | CodeRef returns false for can_be_inlined'
);
}