Source

p5-types-xsd / t / 02datetimes.t

Diff from to

File t/02datetimes.t

 should_fail('2009-02-12T03:54:00', DateTime[explicitTimezone => "required"]);
 should_pass('2009-02-12T03:54:00', DateTime[explicitTimezone => "prohibited"]);
 
+should_pass('2009-02-12T03:54:00', DateTime[assertion => sub { m/^2009/ }]);
+should_pass('2009-02-12T03:54:00', DateTime[assertion => 'm/^2009/']);
+should_fail('2010-02-12T03:54:00', DateTime[assertion => sub { m/^2009/ }]);
+should_fail('2010-02-12T03:54:00', DateTime[assertion => 'm/^2009/']);
+
+should_pass('2009-02-12T03:54:00', DateTime[assertion => [sub { m/^2009/ }, 'm/-02-/']]);
+
 done_testing;