File: perl_highlighting.t

package info (click to toggle)
libsyntax-highlight-engine-kate-perl 0.10%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 3,844 kB
  • ctags: 2,233
  • sloc: perl: 84,056; ruby: 176; asm: 166; sh: 162; cpp: 144; jsp: 128; haskell: 116; f90: 99; python: 98; ml: 75; xml: 43; yacc: 37; ansic: 32; tcl: 29; lisp: 24; makefile: 14; awk: 13; php: 5
file content (26 lines) | stat: -rw-r--r-- 735 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
24
25
26
use strict;
use warnings;

use Test::More;
use Test::Differences;
use lib 't/lib';
use TestHighlight ':all';

diag <<'END';
We don't actually know if these are highlighted correctly, but this
makes decent regression tests when we refactor.
END

my ( $before, $after ) = ( 't/perl/before', 't/perl/highlighted' );

my $highlighted_version_of = get_sample_perl_files();
plan tests => scalar keys %$highlighted_version_of;

for my $perl ( sort keys %$highlighted_version_of ) {
    my $highlighted = $highlighted_version_of->{$perl};
    my $have        = get_highlighter('Perl')->highlightText( slurp($perl) );
    my $want        = slurp($highlighted);
	chomp $want;

    eq_or_diff $have, $want, "($perl) was highlighted correctly";
}