File: 3.t

package info (click to toggle)
libtext-context-perl 3.7-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 96 kB
  • sloc: perl: 167; makefile: 2
file content (11 lines) | stat: -rw-r--r-- 406 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
#!/usr/bin/perl 
use Text::Context;
use Test::More 'no_plan';

# We want to test snippeting of things which should be marked up as HTML
# entities.
my $s = Text::Context->new('<html> find <me> s&z </html>', "me", "s&z");

my $output = '&lt;html&gt; find &lt;<span class="quoted">me</span>&gt; <span class="quoted">s&amp;z</span> &lt;/html&gt;';

is($s->as_html, $output, "entities are handled correctly");