1 # Copyright (C) 2002, 2003 Free Software Foundation, Inc.
3 # This file is part of GNU Automake.
5 # GNU Automake is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3, or (at your option)
10 # GNU Automake is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 use Automake
::Version
;
22 sub test_version_compare
24 my ($left, $right, $result) = @_;
25 my @leftver = Automake
::Version
::split ($left);
26 my @rightver = Automake
::Version
::split ($right);
29 print "can't grok \"$left\"\n";
35 print "can't grok \"$right\"\n";
39 my $res = Automake
::Version
::compare
(@leftver, @rightver);
42 print "compare (\"$left\", \"$right\") = $res! (not $result?)\n";
65 ['1.5.4', '1.6.1', -1],
68 ['1.5a', '1.5.1a', 1],
69 ['1.5a', '1.5.1f', 1],
70 ['1.5', '1.5.1a', -1],
71 ['1.5.1a', '1.5.1f', -1],
73 ['1.6-p5a', '1.6.5a', 0],
74 ['1.6', '1.6-p5a', -1],
75 ['1.6-p4b', '1.6-p5a', -1],
76 ['1.6-p4b', '1.6-foo', 1],
77 ['1.6-p4b', '1.6a-foo', -1]
80 test_version_compare
(@
{$_}) foreach @tests;
84 ### Setup "GNU" style for perl-mode and cperl-mode.
86 ## perl-indent-level: 2
87 ## perl-continued-statement-offset: 2
88 ## perl-continued-brace-offset: 0
89 ## perl-brace-offset: 0
90 ## perl-brace-imaginary-offset: 0
91 ## perl-label-offset: -2
92 ## cperl-indent-level: 2
93 ## cperl-brace-offset: 0
94 ## cperl-continued-brace-offset: 0
95 ## cperl-label-offset: -2
96 ## cperl-extra-newline-before-brace: t
97 ## cperl-merge-trailing-else: nil
98 ## cperl-continued-statement-offset: 2