File: perl_todo.t

package info (click to toggle)
libsyntax-highlight-engine-kate-perl 0.14%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 3,848 kB
  • sloc: perl: 84,065; ruby: 176; asm: 166; cpp: 144; jsp: 128; haskell: 116; sh: 111; f90: 99; python: 98; ml: 75; xml: 43; yacc: 37; ansic: 32; tcl: 29; lisp: 24; makefile: 14; awk: 13; php: 5
file content (77 lines) | stat: -rw-r--r-- 1,800 bytes parent folder | download | duplicates (4)
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
use strict;
use warnings;

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

plan tests => 2;

# https://rt.cpan.org/Ticket/Display.html?id=76182
my $underscore_bug = <<'END';
my
$underscore_bug
=
10_000
;
END

my $want = <<'END';
<keyword>my</keyword><normal>
</normal><variable>$underscore_bug</variable><datatype>
</datatype><operator>=</operator><normal>
</normal><float>10_100</float><normal>
</normal><operator>;</operator><normal>
</normal>
END
my $have = highlight_perl($underscore_bug);
TODO: {
    local $TODO = 'Kate does not yet handle numbers with underscores (10_000)';
    eq_or_diff $have, $want, 'Numbers with underscores should parse correctly';
}

# https://rt.cpan.org/Ticket/Display.html?id=76168
my $heredoc_bug = <<'END';
my $heredoc_bug = <<'HEY';
We be here
HEY! <-- this is not the terminator
and here
HEY
END
$have = highlight_perl($heredoc_bug);

$want = <<'END';
<keyword>my</keyword><normal> </normal><variable>$heredoc_bug</variable><normal> </normal><operator>=</operator><operator> <<</operator><keyword>'HEY';</keyword><normal>
</normal><string>We be here</string><normal>
</normal><string>HEY! <-- this is not the terminator</string><normal>
</normal><string>and here</string><normal>
</normal><keyword>HEY</keyword><normal>
</normal>
END

TODO: {
    local $TODO = 'Kate sometimes guesses the heredoc terminator incorrectly';
    eq_or_diff $have, $want, 'heredocs should parse correctly';
}
__END__

#!/usr/bin/env perl


my $heredoc_bug = <<'HEY';
We be here
HEY! <-- this is not the terminator
and here
HEY

# https://rt.cpan.org/Ticket/Display.html?id=76160

=head1 BORKED

All Perl code after this was considered a "comment" and Kate could not
highlight it correctly.

=cut

my $this_is_not_a_comment = 'or a pipe';