⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.177
Server IP:
50.6.168.112
Server:
Linux server-617809.webnetzimbabwe.com 5.14.0-570.25.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jul 9 04:57:09 EDT 2025 x86_64
Server Software:
Apache
PHP Version:
8.4.10
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
.cpan
/
build
/
JSON-4.10-0
/
t
/
View File Name :
117_numbers.t
use Test::More; use strict; use warnings; BEGIN { $ENV{PERL_JSON_BACKEND} ||= "JSON::backportPP"; } BEGIN { $ENV{PERL_JSON_PP_USE_B} = 0 } use JSON; BEGIN { plan skip_all => "requires $JSON::BackendModule 2.90 or newer" if JSON->backend->is_pp and eval $JSON::BackendModule->VERSION < 2.90 } BEGIN { plan skip_all => "not for $JSON::BackendModule" if $JSON::BackendModule eq 'JSON::XS' } BEGIN { plan tests => 3 } # TODO ("inf"/"nan" representations are not portable) # is encode_json([9**9**9]), '["inf"]'; # is encode_json([-sin(9**9**9)]), '["nan"]'; my $num = 3; my $str = "$num"; is encode_json({test => [$num, $str]}), '{"test":[3,"3"]}'; $num = 3.21; $str = "$num"; is encode_json({test => [$num, $str]}), '{"test":[3.21,"3.21"]}'; $str = '0 but true'; $num = 1 + $str; is encode_json({test => [$num, $str]}), '{"test":[1,"0 but true"]}';