Posted to tcl by pooryorick at Wed May 04 04:56:36 GMT 2016view raw
- proc find _ {
- set root [$_ eav set [$_ $ entity] root]
- relay accept sender [info coroutine]
- set res [$_ eav find * descend {parent entity == $root} eval record {
- relay deliver 0 $sender [array get record]
- relay accept sender
- }]
- relay deliver 0 $sender {}
- }
- [namespace current] method find
- test fileset_find {} -setup $setup1 -body {
- set res {}
- set path [file join $tempdir a]
- [dir fileset spawn myfileset] init path $path
- myfileset scan
- relay iter item [coroutine b myfileset find] {
- lappend res $item
- }
- set res
- } -cleanup $cleanup1 -result {/a/four /a/three /a/two}