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 ].
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.
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 ]]]]
````
Regards .. Subbu