help.lint.coverage: fix for shadowing "empty" word; prevent the other test-only words from being shadowed too

clean-macosx-x86-64
Cat Stevens 2019-11-09 17:08:24 -05:00 committed by John Benediktsson
parent fb9359d26a
commit 465facfde3
2 changed files with 19 additions and 19 deletions

View File

@ -10,7 +10,7 @@ PRIVATE>
ABOUT: "help.lint.coverage" ABOUT: "help.lint.coverage"
ARTICLE: "help.lint.coverage" "Help coverage linting" ARTICLE: "help.lint.coverage" "Help coverage linting"
"The " { $vocab-link "help.lint.coverage" } " vocabulary implements a very picky documentation completeness checker." "The " { $vocab-link "help.lint.coverage" } " vocabulary implements a very pedantic documentation completeness checker."
$nl $nl
"The documentation coverage linter requires most words to have " { $link POSTPONE: HELP: } " declarations defining some of the " "The documentation coverage linter requires most words to have " { $link POSTPONE: HELP: } " declarations defining some of the "
{ $links $values $description $error-description $class-description $examples } " sections (see " { $links "element-types" } ")." { $links $values $description $error-description $class-description $examples } " sections (see " { $links "element-types" } ")."

View File

@ -5,22 +5,22 @@ tools.test vocabs ;
IN: help.lint.coverage.tests IN: help.lint.coverage.tests
<PRIVATE <PRIVATE
: empty ( a v -- x y ) ; : an-empty-word-with-a-unique-name ( a v -- x y ) ;
: nonexistent ( a v -- x y ) ; : a-nonexistent-word ( a v -- x y ) ;
: defined ( x -- x ) ; : a-defined-word ( x -- x ) ;
HELP: empty { $examples } ; HELP: an-empty-word-with-a-unique-name { $examples } ;
HELP: nonexistent ; HELP: a-nonexistent-word ;
HELP: defined { $examples { $example "USING: prettyprint ; " "1 ." "1" } } ; HELP: a-defined-word { $examples { $example "USING: prettyprint ; " "1 ." "1" } } ;
PRIVATE> PRIVATE>
{ t } [ \ empty empty-examples? ] unit-test { t } [ \ an-empty-word-with-a-unique-name empty-examples? ] unit-test
{ f } [ \ nonexistent empty-examples? ] unit-test { f } [ \ a-nonexistent-word empty-examples? ] unit-test
{ f } [ \ defined empty-examples? ] unit-test { f } [ \ a-defined-word empty-examples? ] unit-test
{ f } [ \ keep empty-examples? ] unit-test { f } [ \ keep empty-examples? ] unit-test
{ { $description $values } } [ \ empty missing-sections natural-sort ] unit-test { { $description $values } } [ \ an-empty-word-with-a-unique-name missing-sections natural-sort ] unit-test
{ { $description $values } } [ \ defined missing-sections natural-sort ] unit-test { { $description $values } } [ \ a-defined-word missing-sections natural-sort ] unit-test
{ { } } [ \ keep missing-sections ] unit-test { { } } [ \ keep missing-sections ] unit-test
{ { "a.b" "a.b.c" } } [ { "a.b" "a.b.private" "a.b.c.private" "a.b.c" } filter-private ] unit-test { { "a.b" "a.b.c" } } [ { "a.b" "a.b.private" "a.b.c.private" "a.b.c" } filter-private ] unit-test
@ -29,13 +29,13 @@ PRIVATE>
{ "section" } [ 1 "section" ?pluralize ] unit-test { "section" } [ 1 "section" ?pluralize ] unit-test
{ "sections" } [ 10 "section" ?pluralize ] unit-test { "sections" } [ 10 "section" ?pluralize ] unit-test
{ { $examples } } [ \ empty word-defines-sections ] unit-test { { $examples } } [ \ an-empty-word-with-a-unique-name word-defines-sections ] unit-test
{ { $examples } } [ \ defined word-defines-sections ] unit-test { { $examples } } [ \ a-defined-word word-defines-sections ] unit-test
{ { } } [ \ nonexistent word-defines-sections ] unit-test { { } } [ \ a-nonexistent-word word-defines-sections ] unit-test
{ { $values $description $examples } } [ \ keep word-defines-sections ] unit-test { { $values $description $examples } } [ \ keep word-defines-sections ] unit-test
{ { $values $contract $examples } } [ \ <word-help-coverage> word-defines-sections ] unit-test { { $values $contract $examples } } [ \ <word-help-coverage> word-defines-sections ] unit-test
{ empty } [ "empty" find-word ] unit-test { an-empty-word-with-a-unique-name } [ "an-empty-word-with-a-unique-name" find-word ] unit-test
{ {
V{ "[" { $[ "math" dup lookup-vocab ] } "] " { "zero?" zero? } ": " } V{ "[" { $[ "math" dup lookup-vocab ] } "] " { "zero?" zero? } ": " }
@ -101,8 +101,8 @@ PRIVATE>
USING: definitions compiler.units ; USING: definitions compiler.units ;
IN: help.lint.coverage.tests.private IN: help.lint.coverage.tests.private
[ [
\ empty forget \ an-empty-word-with-a-unique-name forget
\ nonexistent forget \ a-nonexistent-word forget
\ defined forget \ a-defined-word forget
] with-compilation-unit ] with-compilation-unit
]] eval( -- ) ]] eval( -- )