Changeset 2219


Ignore:
Timestamp:
12/28/08 11:36:13 (3 years ago)
Author:
szabgab
Message:

add more test cases to the beginner error catching coe

Location:
trunk/Padre/t
Files:
4 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Padre/t/75-perl-beginner.t

    r2218 r2219  
    2828    'chomp.pl'                     => 'TODO', 
    2929    'substitute_in_map.pl'         => 'TODO', 
     30    'unintented_glob.pl'           => 'TODO', 
     31    'return_stronger_than_or.pl'   => 'TODO', 
     32    'grep_always_true.pl'          => 'TODO', 
     33    'mu_argv.pl'                   => 'TODO', 
    3034    ); 
    3135} 
     36 
     37# probably already in some Perl Critic rules 
     38# lack of use strict; and lack of use warnings; should be also reported. 
     39 
     40# this might be also in some Perl Critic rules  
     41#my $filename = 'input.txt'; 
     42#open my $fh, '<', $filename || die $!; 
     43# problem: precedence of || is higher than that of , so the above code is actually 
     44# the same as: 
     45# open my $fh, '<', ($filename || die $!); 
     46# which will only die if the $filename is false, nothing to do with 
     47# success of failure of open() 
     48 
     49 
     50# without "use warning" this 'works' noiselessly 
     51# I am not sure we need to look for such as we should always 
     52# tell users to 'use warnings' 
     53#my $x = 23; 
     54#my $z = 3; 
     55#if ($x = 7) { 
     56#   print "xx\n"; 
     57#} 
     58# 
     59 
    3260 
    3361foreach my $file (keys %tests) { 
  • trunk/Padre/t/files/beginner/substitute_in_map.pl

    r2218 r2219  
    99# problem: s/// does not return the substituted string so the above should be written as 
    1010# @data = map { s/./X/; $_ } @data; 
     11# substitute actually returns the number of substitutions which is of course will alway be 1  
     12# unless we use global matching: /g 
Note: See TracChangeset for help on using the changeset viewer.