diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2004-05-08 22:23:50 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2004-05-08 22:23:50 +0000 |
commit | 01d3471d6b083b5b1f37d959bc0fbb4d03adad80 (patch) | |
tree | 08572a28740f8f41ccaf9bb09da60a464d9d1e00 /perl_checker.src/test | |
parent | 7de977a58ea74ceda04eb09e1af2dc209ed8f42c (diff) | |
download | perl_checker-01d3471d6b083b5b1f37d959bc0fbb4d03adad80.tar perl_checker-01d3471d6b083b5b1f37d959bc0fbb4d03adad80.tar.gz perl_checker-01d3471d6b083b5b1f37d959bc0fbb4d03adad80.tar.bz2 perl_checker-01d3471d6b083b5b1f37d959bc0fbb4d03adad80.tar.xz perl_checker-01d3471d6b083b5b1f37d959bc0fbb4d03adad80.zip |
better contexts
Diffstat (limited to 'perl_checker.src/test')
-rw-r--r-- | perl_checker.src/test/context.t | 8 | ||||
-rw-r--r-- | perl_checker.src/test/return_value.t | 5 |
2 files changed, 9 insertions, 4 deletions
diff --git a/perl_checker.src/test/context.t b/perl_checker.src/test/context.t index edb0452..c0bc221 100644 --- a/perl_checker.src/test/context.t +++ b/perl_checker.src/test/context.t @@ -1,4 +1,5 @@ -foreach (%h) {} foreach with a hash is usually an error +foreach (%h) {} context hash is not compatible with context list + foreach with a hash is usually an error map { 'xxx' } %h a hash is not a valid parameter to function map @@ -10,8 +11,11 @@ length @l never use "length @l", it returns the l %h . 'yyy' context hash is not compatible with context string -'xxx' > 'yyy' you should use a string operator, not the number operator ">" +'xxx' > 'yyy' context string is not compatible with context float + context string is not compatible with context float + you should use a string operator, not the number operator ">" 1 cmp 2 you should use a number operator, not the string operator "cmp" (or replace the number with a string) $xxx == undef context undef is not compatible with context float + diff --git a/perl_checker.src/test/return_value.t b/perl_checker.src/test/return_value.t index e826c08..fd8eafd 100644 --- a/perl_checker.src/test/return_value.t +++ b/perl_checker.src/test/return_value.t @@ -1,8 +1,8 @@ if ($xxx or $yyy) {} value should be dropped - context () is not compatible with context scalar + context () is not compatible with context bool if ($xxx and $yyy) {} value should be dropped - context () is not compatible with context scalar + context () is not compatible with context bool $xxx && yyy(); value is dropped @@ -14,3 +14,4 @@ map { xxx($_) } @l; if you don't use the return value, use $xxx = chomp; () context not accepted here context () is not compatible with context scalar + |