in reply to Is a here-doc a good way to retrieve data file contents for testing?
Maybe cleaner, or maybe not ...
#!/usr/bin/perl use strict; use warnings; use Test::More tests => 1; print "-------\n"; print json_q(); print "-------\n"; print json_here(); print "-------\n"; is(json_q(), json_here(), "should be the same"); sub json_q { q( "Type": 0, "Width": 504, "X": 18, "Y": 18 } ] }); } sub json_here { <<'END_JSON' =~ s/\n\z//r } "Type": 0, "Width": 504, "X": 18, "Y": 18 } ] } END_JSON
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Is a here-doc a good way to retrieve data file contents for testing?
by haukex (Archbishop) on Jan 17, 2021 at 08:42 UTC | |
|
Re^2: Is a here-doc a good way to retrieve data file contents for testing? (updated)
by LanX (Saint) on Jan 17, 2021 at 02:04 UTC | |
by tybalt89 (Monsignor) on Jan 17, 2021 at 02:56 UTC | |
by LanX (Saint) on Jan 17, 2021 at 03:24 UTC | |
by Corion (Patriarch) on Jan 17, 2021 at 07:06 UTC | |
by haukex (Archbishop) on Jan 17, 2021 at 08:51 UTC | |
|