]> gitweb.factorcode.org Git - factor.git/commitdiff
help.lint.coverage: change to use a find-word that doesn't use search.
authorJohn Benediktsson <mrjbq7@gmail.com>
Mon, 5 Feb 2018 23:42:36 +0000 (15:42 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Mon, 5 Feb 2018 23:42:36 +0000 (15:42 -0800)
When run with the test runner, manifest is ``f``, so ``search`` breaks.

extra/help/lint/coverage/coverage-tests.factor
extra/help/lint/coverage/coverage.factor

index 721eba1e4be16fd33bfea8d88861a141f3df4c67..1839d6051e6ad55301a81412eeaf45a9f6f0e584 100644 (file)
@@ -1,6 +1,6 @@
-USING: accessors fuel.help.private help.lint.coverage
-help.lint.coverage.private help.markup help.syntax kernel
-literals math math.matrices sequences sorting tools.test vocabs ;
+USING: accessors help.lint.coverage help.lint.coverage.private
+help.markup help.syntax kernel literals math math.matrices
+sequences sorting tools.test vocabs ;
 IN: help.lint.coverage.tests
 
 <PRIVATE
@@ -10,7 +10,7 @@ IN: help.lint.coverage.tests
 
 HELP: empty { $examples } ;
 HELP: nonexistent ;
-HELP: defined { $examples { $example "USING: prettyprint ; ""1 ." "1" } } ;
+HELP: defined { $examples { $example "USING: prettyprint ; " "1 ." "1" } } ;
 PRIVATE>
 
 { t } [ \ empty empty-examples? ] unit-test
index 73e695d018ccd53aba0b46e07433cafbb1fa5b0b..90dbe518accb45c3fd380394fa966e891d67e9cf 100644 (file)
@@ -1,9 +1,8 @@
-USING: accessors arrays classes classes.error combinators
-combinators.short-circuit continuations english eval formatting
-fry fuel.help.private generic help help.lint help.lint.checks help.markup io
-io.streams.string io.styles kernel math namespaces parser
-prettyprint sequences sequences.deep sets sorting splitting strings summary
-vocabs words ;
+USING: accessors arrays assocs classes classes.error combinators
+continuations english formatting fry generic help
+help.lint.checks help.markup io io.streams.string io.styles
+kernel math namespaces parser sequences sequences.deep sets
+sorting splitting strings summary vocabs vocabs.parser words ;
 FROM: namespaces => set ;
 IN: help.lint.coverage
 
@@ -107,6 +106,14 @@ M: word-help-coverage summary
 
 : missing-sections ( word -- missing )
     [ should-define ] [ word-defines-sections ] bi diff ;
+
+: find-word ( name -- word/f )
+    dup words-named dup length {
+        { 0 [ 2drop f ] }
+        { 1 [ first nip ] }
+        [ drop <ambiguous-use-error> throw-restarts ]
+    } case ;
+
 PRIVATE>
 
 GENERIC: <word-help-coverage> ( word -- coverage )