K
view release on metacpan or search on metacpan
s++; if (s == send || (*s != 'F' && *s != 'f')) return 0;
s++; if (s < send && (*s == 'I' || *s == 'i')) {
s++; if (s == send || (*s != 'N' && *s != 'n')) return 0;
s++; if (s == send || (*s != 'I' && *s != 'i')) return 0;
s++; if (s == send || (*s != 'T' && *s != 't')) return 0;
s++; if (s == send || (*s != 'Y' && *s != 'y')) return 0;
s++;
}
sawinf = 1;
} else if (*s == 'N' || *s == 'n') {
/* XXX TODO: There are signaling NaNs and quiet NaNs. */
s++; if (s == send || (*s != 'A' && *s != 'a')) return 0;
s++; if (s == send || (*s != 'N' && *s != 'n')) return 0;
s++;
sawnan = 1;
} else
return 0;
if (sawinf) {
numtype &= IS_NUMBER_NEG; /* Keep track of sign */
numtype |= IS_NUMBER_INFINITY | IS_NUMBER_NOT_INT;
is k( $handle, '" "' ), ' ', 'null char'; # this ones weird
is k( $handle, '`' ), undef, 'null sym';
is k( $handle, '0Nm' ), undef, 'null month';
is k( $handle, '0Nd' ), undef, 'null day';
is k( $handle, '0Nz' ), undef, 'null datetime';
is k( $handle, '0Np' ), undef, 'null timestamp';
is k( $handle, '0Nu' ), undef, 'null minute';
is k( $handle, '0Nv' ), undef, 'null second';
is k( $handle, '0Nt' ), undef, 'null time';
is k( $handle, '0n' ), undef, 'NaN';
}
sub infinity_scalar_tests {
my ($handle) = @_;
is k( $handle, '0Wh' ), 'inf', '+infinite short';
is k( $handle, '0W' ), 'inf', '+infinite int';
is k( $handle, '0Wj' ), 'inf', '+infinite long';
is k( $handle, '0We' ), 'inf', '+infinite real';
is k( $handle, '0w' ), 'inf', '+infinite float';
is_deeply k( $handle, '(),0n' ), [ undef ], 'null float vector';
is_deeply k( $handle, '(),`' ), [ undef ], 'null sym vector';
is_deeply k( $handle, '(),0Nm' ), [ undef ], 'null month vector';
is_deeply k( $handle, '(),0Nd' ), [ undef ], 'null day vector';
is_deeply k( $handle, '(),0Nz' ), [ undef ], 'null datetime vector';
is_deeply k( $handle, '(),0Np' ), [ undef ], 'null timestamp vector';
is_deeply k( $handle, '(),0Nu' ), [ undef ], 'null minute vector';
is_deeply k( $handle, '(),0Nv' ), [ undef ], 'null second vector';
is_deeply k( $handle, '(),0Nt' ), [ undef ], 'null time vector';
is_deeply k( $handle, '(),0n' ), [ undef ], 'NaN vector';
}
sub infinite_vector_tests {
my ($handle) = @_;
is_deeply k( $handle, '(),0Wh' ), [ 'inf' ], '+infinite short vector';
is_deeply k( $handle, '(),0W' ), [ 'inf' ], '+infinite int vector';
is_deeply k( $handle, '(),0Wj' ), [ 'inf' ], '+infinite long vector';
is_deeply k( $handle, '(),0We' ), [ 'inf' ], '+infinite real vector';
is_deeply k( $handle, '(),0w' ), [ 'inf' ], '+infinite float vector';
( run in 0.270 second using v1.01-cache-2.11-cpan-fd5d4e115d8 )