Don't test coverage of auto-generated class predicates. Get a better count of callabales in a word to fix %coverage.

db4
Doug Coleman 2011-11-01 16:46:02 -07:00
parent a647df58f6
commit 4002945c09
1 changed files with 4 additions and 4 deletions

View File

@ -4,7 +4,7 @@ USING: accessors assocs fry io kernel math prettyprint
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? ;
@ -32,7 +32,7 @@ GENERIC: reset-coverage ( object -- )
".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>
@ -110,7 +110,7 @@ M: string count-callables
[ count-callables ] map-words sum ;
M: word count-callables
"coverage" word-prop assoc-size ;
def>> [ callable? ] deep-filter length ;
PRIVATE>
@ -128,5 +128,5 @@ PRIVATE>
] bi ;
: %coverage ( string -- x )
[ coverage values concat length ]
[ test-coverage values concat length ]
[ count-callables ] bi [ swap - ] keep /f ; inline