File: js2perl.t

package info (click to toggle)
libjavascript-quickjs-perl 0.21-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,180 kB
  • sloc: ansic: 72,822; javascript: 7,743; perl: 1,065; makefile: 353; sh: 108
file content (21 lines) | stat: -rw-r--r-- 391 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env perl

use strict;
use warnings;

use Test::More;
use Test::FailWarnings;

use JavaScript::QuickJS;

my $js = JavaScript::QuickJS->new();

eval { $js->eval('[BigInt(123)]') };
my $err = $@;
like($err, qr<big\s*int>i, 'BigInt in array');

eval { $js->eval('let foo = { foo: BigInt(123) }; foo') };
$err = $@;
like($err, qr<big\s*int>i, 'BigInt in plain object');

done_testing;