Changeset 146718 for trunk/base


Ignore:
Timestamp:
Mar 15, 2016, 5:55:59 PM (4 years ago)
Author:
raimue@…
Message:

Fix test for reclaim::walk_files

The test was probably written for a previous iteration of the implementation.
Now it will match the existing implementation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/src/macports1.0/tests/reclaim.test

    r146717 r146718  
    9090    set good_dist   [file join $dir good_distfile.txt]
    9191    set dist_list   [list]
     92    set unused_list [list]
    9293
    9394    lappend dist_list $good_dist
     
    104105    close $fd
    105106
    106     reclaim::walk_files $dir yes $dist_list
     107    reclaim::walk_files $dir $dist_list unused_list
    107108
    108     if {[file exists $bad_dist] || [file exists $bad_dist2] || [file exists $subdir] || ![file exists $good_dist] || ![file exists $dir]} {
    109         return "FAIL: Did not delete the correct files, or deleted files that should not have been deleted."
     109    if {[lsearch -exact $unused_list $bad_dist] == -1} {
     110        return "FAIL: bad_dist should be deleted"
     111    }
     112    if {[lsearch -exact $unused_list $bad_dist2] == -1} {
     113        return "FAIL: bad_dist2 should be deleted"
     114    }
     115    if {[lsearch -exact $unused_list $good_dist] != -1} {
     116        return "FAIL: good_dist should NOT be deleted"
     117    }
     118    if {[lsearch -exact $unused_list $dir] != -1} {
     119        return "FAIL: good_dist should NOT be deleted"
    110120    }
    111121
Note: See TracChangeset for help on using the changeset viewer.