On Fri, 21 Jun 2019 at 12:43, K K Subbu <kksubbu...@gmail.com> wrote:
> Nice graph, Ben! The larger test names (selector size > 100) look more > like sentences than names ;-). > > On 21/06/19 6:50 AM, Ben Coman wrote: > > classes := Object allSubclasses select: [ :cc | cc isKindOf: > > TestCase class ]. > > methods := c flatCollect: [ :c | c allMethods ]. > Ahh, yes. Blame evolution of the Playground code between when I used it and when I copied it here. > Did you mean "classes" flatCollect: here? > > > tests := methods select: [ :m | m selector beginsWith: 'test' ]. > > lengths := tests collect: [ :m | m selector size ]. > > select:thenCollect: can also be used here. > yes. but I was checking each stage as it grew incrementally. > > > lengths asBag keysAndValuesDo: [ :len :count | Transcript crShow: > > len; show: ','; show: count ] > > I find the in: selector very handy for quick commands without having to > use undefined temps. e.g. > ```` > (Object allSubclasses select: [ :cc | cc isKindOf: TestCase class ]) in: > [ :classes | > (classes flatCollect: [ :c | c allMethods ]) in: [ > :methods | > (methods select: [ :m | m selector beginsWith: > 'test' ] thenCollect: > [ :m | m selector size ]) in: [:lengths | > lengths asBag keysAndValuesDo: [ :len > :count | Transcript crShow: > len; show: ','; show: count ]]]] > ```` > cool cheers -ben