xref: /openbsd-src/gnu/usr.bin/perl/ext/XS-APItest/t/my_strtod.t (revision 256a93a44f36679bee503f12e49566c2183f6181)
1#!perl -w
2use strict;
3
4use Test::More;
5use Config;
6use XS::APItest;
7
8my ($nv, $rest);
9
10# GH 19492 - d_strtod=undef build segfaults here
11($nv, $rest) = my_strtod('17.265625x');
12# Note that .265625 is 17/64 so it can be represented exactly
13is($nv, 17.265625, 'my_strtod("17.265625x", &e) returns 17.265625');
14is($rest, 'x', 'my_strtod("17.265625x", &e) sets e to "x"');
15
16done_testing();
17