On Fri Sep 05 09:27:33 2014, torbjorn wrote:
Show quoted text
Attaching the test case on that paste, seems more permanent
=head1 PURPOSE
Various tests validating scientific numbers
=cut
use Test::More;
use strict;
use warnings;
use JSON::Schema;
my $schema = JSON::Schema->new({
type => 'object',
properties => {
mynumber => { type => 'number' }
}
});
my $data = { mynumber => "1e2" };
my $result = $schema->validate($data);
ok $result, 'scientific notation'
or map { diag "reason: $_" } $result->errors;
use Scalar::Util qw/looks_like_number/;
ok looks_like_number "1e2", "but it sure quacks like a duck";
done_testing;