OLD | NEW |
1 #!/usr/bin/perl -w | 1 #!/usr/bin/perl -w |
2 # | 2 # |
3 # Copyright (C) 2011 Research In Motion Limited. All rights reserved. | 3 # Copyright (C) 2011 Research In Motion Limited. All rights reserved. |
4 # | 4 # |
5 # This library is free software; you can redistribute it and/or | 5 # This library is free software; you can redistribute it and/or |
6 # modify it under the terms of the GNU Lesser General Public | 6 # modify it under the terms of the GNU Lesser General Public |
7 # License as published by the Free Software Foundation; either | 7 # License as published by the Free Software Foundation; either |
8 # version 2.1 of the License, or (at your option) any later version. | 8 # version 2.1 of the License, or (at your option) any later version. |
9 # | 9 # |
10 # This library is distributed in the hope that it will be useful, | 10 # This library is distributed in the hope that it will be useful, |
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 # Lesser General Public License for more details. | 13 # Lesser General Public License for more details. |
14 # | 14 # |
15 # You should have received a copy of the GNU Lesser General Public | 15 # You should have received a copy of the GNU Lesser General Public |
16 # License along with this library; if not, write to the Free Software | 16 # License along with this library; if not, write to the Free Software |
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | 17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
18 | 18 |
19 # Unit tests of VCSUtils::parseFirstEOL(). | 19 # Unit tests of VCSUtils::parseFirstEOL(). |
20 | 20 |
21 use strict; | 21 use strict; |
22 use warnings; | 22 use warnings; |
23 | 23 |
24 use Test::Simple tests => 7; | 24 use Test::Simple tests => 7; |
(...skipping 29 matching lines...) Expand all Loading... |
54 $title = "parseFirstEOL: Line with a mix of line endings."; | 54 $title = "parseFirstEOL: Line with a mix of line endings."; |
55 ok(firstEOLInString("This line contains a mix of line endings.\r\n\r\n\r\r\n\n\n
\n") eq "\r\n", $title); | 55 ok(firstEOLInString("This line contains a mix of line endings.\r\n\r\n\r\r\n\n\n
\n") eq "\r\n", $title); |
56 | 56 |
57 sub firstEOLInString | 57 sub firstEOLInString |
58 { | 58 { |
59 my ($string) = @_; | 59 my ($string) = @_; |
60 my $fileHandle; | 60 my $fileHandle; |
61 open($fileHandle, "<", \$string); | 61 open($fileHandle, "<", \$string); |
62 return parseFirstEOL($fileHandle); | 62 return parseFirstEOL($fileHandle); |
63 } | 63 } |
OLD | NEW |