quotations sequences sequences.deep splitting strings
tools.annotations vocabs words arrays words.symbol
combinators.short-circuit values tools.test
-combinators continuations ;
+combinators continuations classes ;
IN: tools.coverage
TUPLE: coverage < identity-tuple executed? ;
".private" ?tail drop ".private" append ;
: coverage-words ( string -- words )
- words [ { [ primitive? not ] [ symbol? not ] } 1&& ] filter ;
+ words [ { [ primitive? not ] [ symbol? not ] [ predicate? not ] } 1&& ] filter ;
PRIVATE>
[ count-callables ] map-words sum ;
M: word count-callables
- "coverage" word-prop assoc-size ;
+ def>> [ callable? ] deep-filter length ;
PRIVATE>
] bi ;
: %coverage ( string -- x )
- [ coverage values concat length ]
+ [ test-coverage values concat length ]
[ count-callables ] bi [ swap - ] keep /f ; inline