File: 5-multi-line.t

package info (click to toggle)
libdata-javascript-perl 1.15-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 288 kB
  • sloc: perl: 319; makefile: 5
file content (23 lines) | stat: -rw-r--r-- 456 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env perl

use Modern::Perl;

use Test2::V0;
use Test2::Tools::Subtest qw/subtest_buffered/;

use Data::JavaScript qw(:all);

my $input = <<'EOF',
This is a multi-line entry.
See? I have two lines.
Now there are three lines!
EOF

my $expected = qq/var multiline = "This is a multi-line entry.\\nSee? I have two lines.\\nNow there are three lines!\\n";\n/;

is
  jsdump( 'multiline', $input ),
  $expected,
  'Multi-line jsdump()';

done_testing;