Skip to content

Commit

Permalink
Units(Perl): add more cases for testing heredoc recognition
Browse files Browse the repository at this point in the history
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
  • Loading branch information
masatake committed Dec 27, 2022
1 parent cb407ee commit 6f5b873
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Units/parser-perl.r/no-heredoc.d/expected.tags
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ heredoc4tag input.pl /^print "abc" . <<heredoc3tag . 'efg' . << "heredoc4tag" .
f7tag input.pl /^sub f7tag() {}$/;" s
f8tag input.pl /^sub f8tag() {}$/;" s
f9tag input.pl /^sub f9tag() {}$/;" s
five_sub input-0.pl /^sub five_sub() {$/;" s
five_mark0 input-0.pl /^print 3 + 2 . <<five_mark0;$/;" h
five_mark1 input-0.pl /^print 3 + 2 . <<~five_mark1;$/;" h
five_mark2 input-0.pl /^print 3 + 2 . << "five_mark2";$/;" h
31 changes: 31 additions & 0 deletions Units/parser-perl.r/no-heredoc.d/input-0.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
print 3 + 2 <<5;
5
;

sub five_sub() {
return 5
}
print 3 + 2 << five_sub;
five
;
print 3 + 2 . <<five_mark0;
a
five_mark0
print 3 + 2 . <<~five_mark1;
a
five_mark1
print 3 + 2 << ~five_sub;
five_sub;
print 3 + 2 . << "five_mark2";
ox
five_mark2

0 comments on commit 6f5b873

Please sign in to comment.