with 'TestRole';
};
-is_deeply([splice @CALLS], [], "no calls to BUILD yet");
-
-ClassWithBUILD->new;
-
-is_deeply([splice @CALLS], [
- 'TestRole::BUILD:before',
- 'ClassWithBUILD::BUILD',
- 'TestRole::BUILD:after',
-]);
-
-ClassWithoutBUILD->new;
-
-is_deeply([splice @CALLS], [
- 'TestRole::BUILD:before',
- 'TestRole::BUILD',
- 'TestRole::BUILD:after',
-]);
-
-ClassWithBUILD->meta->make_immutable;
-ClassWithoutBUILD->meta->make_immutable;
-
-is_deeply([splice @CALLS], [], "no calls to BUILD yet");
-
-ClassWithBUILD->new;
-
-is_deeply([splice @CALLS], [
- 'TestRole::BUILD:before',
- 'ClassWithBUILD::BUILD',
- 'TestRole::BUILD:after',
-]);
-
-ClassWithoutBUILD->new;
-
-is_deeply([splice @CALLS], [
- 'TestRole::BUILD:before',
- 'TestRole::BUILD',
- 'TestRole::BUILD:after',
-]);
+{
+ is_deeply([splice @CALLS], [], "no calls to BUILD yet");
+
+ ClassWithBUILD->new;
+
+ is_deeply([splice @CALLS], [
+ 'TestRole::BUILD:before',
+ 'ClassWithBUILD::BUILD',
+ 'TestRole::BUILD:after',
+ ]);
+
+ ClassWithoutBUILD->new;
+
+ is_deeply([splice @CALLS], [
+ 'TestRole::BUILD:before',
+ 'TestRole::BUILD',
+ 'TestRole::BUILD:after',
+ ]);
+
+ if (ClassWithBUILD->meta->is_mutable) {
+ ClassWithBUILD->meta->make_immutable;
+ ClassWithoutBUILD->meta->make_immutable;
+ redo;
+ }
+}