]> gitweb.factorcode.org Git - factor.git/commitdiff
Don't test coverage of auto-generated class predicates. Get a better count of callaba...
authorDoug Coleman <doug.coleman@gmail.com>
Tue, 1 Nov 2011 23:46:02 +0000 (16:46 -0700)
committerDoug Coleman <doug.coleman@gmail.com>
Wed, 2 Nov 2011 00:13:11 +0000 (17:13 -0700)
basis/tools/coverage/coverage.factor

index 7fa34d59e8d532693c8e79362ea37af5ccb4c4ce..14bf4a9992ad398e11b5bff6fad2aa053d3022df 100644 (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