use strict; use warnings; use Test::More tests => 2; use Plack::Test; use HTTP::Request::Common; { package App; use Dancer2; set show_stacktrace => 1; } my $test = Plack::Test->create( App->to_app ); my $content = $test->request( GET '/nonexistent_pathcrazy' )->content; like $content, qr{/nonexistent_path<strong>crazy</strong>}, "Escaped message"; unlike $content, qr{/nonexistent_pathcrazy}, "No unescaped message";