help.lint.coverage: change to use a find-word that doesn't use search.

When run with the test runner, manifest is ``f``, so ``search`` breaks.
factor-shell
John Benediktsson 2018-02-05 15:42:36 -08:00
parent 849b6d76f4
commit 3a23a92531
2 changed files with 17 additions and 10 deletions

View File

@ -1,6 +1,6 @@
USING: accessors fuel.help.private help.lint.coverage USING: accessors help.lint.coverage help.lint.coverage.private
help.lint.coverage.private help.markup help.syntax kernel help.markup help.syntax kernel literals math math.matrices
literals math math.matrices sequences sorting tools.test vocabs ; sequences sorting tools.test vocabs ;
IN: help.lint.coverage.tests IN: help.lint.coverage.tests
<PRIVATE <PRIVATE
@ -10,7 +10,7 @@ IN: help.lint.coverage.tests
HELP: empty { $examples } ; HELP: empty { $examples } ;
HELP: nonexistent ; HELP: nonexistent ;
HELP: defined { $examples { $example "USING: prettyprint ; ""1 ." "1" } } ; HELP: defined { $examples { $example "USING: prettyprint ; " "1 ." "1" } } ;
PRIVATE> PRIVATE>
{ t } [ \ empty empty-examples? ] unit-test { t } [ \ empty empty-examples? ] unit-test

View File

@ -1,9 +1,8 @@
USING: accessors arrays classes classes.error combinators USING: accessors arrays assocs classes classes.error combinators
combinators.short-circuit continuations english eval formatting continuations english formatting fry generic help
fry fuel.help.private generic help help.lint help.lint.checks help.markup io help.lint.checks help.markup io io.streams.string io.styles
io.streams.string io.styles kernel math namespaces parser kernel math namespaces parser sequences sequences.deep sets
prettyprint sequences sequences.deep sets sorting splitting strings summary sorting splitting strings summary vocabs vocabs.parser words ;
vocabs words ;
FROM: namespaces => set ; FROM: namespaces => set ;
IN: help.lint.coverage IN: help.lint.coverage
@ -107,6 +106,14 @@ M: word-help-coverage summary
: missing-sections ( word -- missing ) : missing-sections ( word -- missing )
[ should-define ] [ word-defines-sections ] bi diff ; [ 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> PRIVATE>
GENERIC: <word-help-coverage> ( word -- coverage ) GENERIC: <word-help-coverage> ( word -- coverage )