1 ! Copyright (C) 2014 Jon Harper.
2 ! See https://factorcode.org/license.txt for BSD license.
3 USING: arrays kernel sequences sorting tools.coverage
4 tools.coverage.private tools.coverage.testvocab
5 tools.coverage.testvocab.child tools.coverage.testvocab.private
6 tools.test vocabs.loader ;
8 { "foo.private" } [ "foo" private-vocab-name ] unit-test
9 { "foo.private" } [ "foo.private" private-vocab-name ] unit-test
12 { halftested mconcat testcond testfry testif testifprivate testmacro untested
14 } [ "tools.coverage.testvocab" [ ] map-words sort ] unit-test
17 "tools.coverage.testvocab"
18 [ V{ } clone [ [ push ] curry each-word ] keep >array ]
19 [ [ ] map-words ] bi =
24 } [ "tools.coverage.testvocab.private" [ ] map-words sort ] unit-test
27 "tools.coverage.testvocab.private"
28 [ V{ } clone [ [ push ] curry each-word ] keep >array ]
29 [ [ ] map-words ] bi =
32 { 3 } [ \ testif count-callables ] unit-test
34 ! Need to reload to flush macro cache
35 ! and have correct coverage statistics
38 { halftested { [ ] } }
47 } [ "tools.coverage.testvocab" [ reload ] [ test-coverage sort ] bi ] unit-test
49 { 0.75 } [ "tools.coverage.testvocab.child" [ reload ] [ %coverage ] bi ] unit-test
54 "tools.coverage.testvocab"
56 { halftested { [ ] } }
67 "tools.coverage.testvocab.child"
68 { { child-halftested { [ ] } } { foo { } } }
72 "tools.coverage.testvocab.child" reload
73 "tools.coverage.testvocab" [ reload ] [ test-coverage-recursively ] bi sort
74 [ first2 sort 2array ] map