diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2004-03-31 14:13:46 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2004-03-31 14:13:46 +0000 |
commit | 492dd716bdbd866fc28eacfe5082910dfa9e7590 (patch) | |
tree | 15bad6962ad73c62835002aadf44dd2163c69282 /perl_checker.src/test/various_errors.t | |
parent | 5a13ba64777f14718ae20e4bca2a80f39304c367 (diff) | |
download | perl_checker-492dd716bdbd866fc28eacfe5082910dfa9e7590.tar perl_checker-492dd716bdbd866fc28eacfe5082910dfa9e7590.tar.gz perl_checker-492dd716bdbd866fc28eacfe5082910dfa9e7590.tar.bz2 perl_checker-492dd716bdbd866fc28eacfe5082910dfa9e7590.tar.xz perl_checker-492dd716bdbd866fc28eacfe5082910dfa9e7590.zip |
add tests for perl_checker
Diffstat (limited to 'perl_checker.src/test/various_errors.t')
-rw-r--r-- | perl_checker.src/test/various_errors.t | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/perl_checker.src/test/various_errors.t b/perl_checker.src/test/various_errors.t new file mode 100644 index 0000000..4ad9976 --- /dev/null +++ b/perl_checker.src/test/various_errors.t @@ -0,0 +1,42 @@ +local $xxx ||= $yyy applying ||= on a new initialized variable is wrong + +$1 =~ s/xxx/yyy/ do not modify the result of a match (eg: $1) + +$xxx[1, 2] you must give only one argument + +$xxx[] you must give one argument + +'' || 'xxx' <constant> || ... is the same as ... + +if ($xxx = '') {} are you sure you did not mean "==" instead of "="? + +N("xxx$yyy") don't use interpolated translated string, use %s or %d instead + +1 + 2 >> 3 missing parentheses (needed for clarity) + +$xxx ? $yyy = 1 : $zzz = 2; missing parentheses (needed for clarity) + +N_("xxx") . 'yyy' N_("xxx") . "yyy" is dumb since the string "xxx" will never get translated + +my (@l2, $xxx) = @l; @l2 takes all the arguments, $xxx is undef in any case + +$bad undeclared variable $bad + +{ my $a } unused variable $a + +my $xxx; yyy($xxx); my $xxx; redeclared variable $xxx + +{ my $xxx; $xxx = 1 } variable $xxx assigned, but not read + +$a undeclared variable $a + +use bad; can't find package bad + +use pkg3 ':bad'; package pkg3 doesn't export tag :bad +bad(); unknown function bad + +use pkg3 ':missing_fs'; name &f is not defined in package pkg3 +f(); name &f0 is not defined in package pkg3 + +use pkg3 'f'; name &f is not defined in package pkg3 +f(); |