Eshu

 view release on metacpan or  search on metacpan

t/0179-hl-ruby.t  view on Meta::CPAN

}

{
    my $out = hl('puts "<b>bold</b>"');
    like($out, qr/&lt;b&gt;bold&lt;\/b&gt;/, 'HTML tags in string escaped');
}

# ── partial keyword non-match ─────────────────────────────────────

{
    my $out = hl('endpoint = 1');
    unlike($out, qr/<span class="esh-k">end<\/span>/, 'end inside identifier not highlighted');
}

{
    my $out = hl('defined?(foo)');
    like($out, qr/<span class="esh-k">defined\?<\/span>/, 'defined? with ? suffix');
}


# ── more keywords ─────────────────────────────────────────────────

t/0187-hl-lua.t  view on Meta::CPAN

}

{
    my $out = hl('utf8.len(s)');
    like($out, qr/<span class="esh-b">utf8<\/span>/, 'utf8 builtin');
}

# ── partial keyword non-match ─────────────────────────────────────

{
    my $out = hl('endpoint');
    unlike($out, qr/<span class="esh-k">end<\/span>/, 'end not matched inside endpoint');
}

{
    my $out = hl('dofile');
    unlike($out, qr/<span class="esh-k">do<\/span>/, 'do not matched inside dofile');
}

done_testing;



( run in 1.658 second using v1.01-cache-2.11-cpan-16aabcbfbcb )