Simplistic implementation of type intersections, modeled after the implementation...
[gitmo/Moose.git] / t / type_constraints / normalize_type_name.t
index e6d7a5a..83eaa37 100644 (file)
@@ -149,4 +149,19 @@ is $union1->name, $union3->name, 'names match';
 
 is $union2->name, $union3->name, 'names match';
 
-done_testing;
+ok my $intersection1 = Moose::Util::TypeConstraints::create_type_constraint_intersection(
+    'ArrayRef[Int|Str] & ArrayRef[Int | HashRef]') => 'Created Intersection1';
+
+ok my $intersection2 = Moose::Util::TypeConstraints::create_type_constraint_intersection(
+    'ArrayRef[  Int|Str] & ArrayRef[Int | HashRef]') => 'Created Intersection2';
+
+ok my $intersection3 = Moose::Util::TypeConstraints::create_type_constraint_intersection(
+    'ArrayRef[Int |Str   ] & ArrayRef[Int | HashRef  ]') => 'Created Intersection3';
+
+is $intersection1->name, $intersection2->name, 'names match';
+
+is $intersection1->name, $intersection3->name, 'names match';
+
+is $intersection2->name, $intersection3->name, 'names match';
+
+done_testing;
\ No newline at end of file