{ an-empty-word-with-a-unique-name } [ "an-empty-word-with-a-unique-name" find-word ] unit-test
+{ { } } [ \ zero-matrix? missing-sections ] unit-test
+{ t } [ \ word-help-coverage? <word-help-coverage> 100%-coverage?>> ] unit-test
+{ t } [ \ zero-matrix? <word-help-coverage> 100%-coverage?>> ] unit-test
+
{
V{ "[" { $[ "math" dup lookup-vocab ] } "] " { "zero?" zero? } ": " }
} [
] unit-test
! make sure this doesn't throw an error (would signify an issue with ignored-words)
-! the contents of all-words is not important
-{ } [ all-words [ <word-help-coverage> ] map drop ] unit-test
+{ } [ { $io-error $prettyprinting-note $nl } [ <word-help-coverage> ] map drop ] unit-test
! Lint system is written weirdly, there's no way to invoke it and get the output
$nl
}
+: (word-help) ( word -- content )
+ dup "help" word-prop [ ] [ word-help* ] ?if ;
+
GENERIC: write-object* ( object -- )
M: string write-object* write ;
M: pair write-object* first2 write-object ;
} cond ?remove-$values ;
: word-defines-sections ( word -- seq )
- "help" word-prop [ ignored-words member? not ] filter [ ?first ] map ;
+ (word-help) [ ignored-words member? ] reject [ ?first ] map ;
! only words that need examples, need to have them nonempty
! not defining examples is not the same as an empty { $examples }
: empty-examples? ( word -- ? )
- "help" word-prop \ $examples swap elements [ f ] [ first rest empty? ] if-empty ;
+ (word-help) \ $examples swap elements [ f ] [ first rest empty? ] if-empty ;
: missing-sections ( word -- missing )
[ should-define ] [ word-defines-sections ] bi diff ;
GENERIC: <word-help-coverage> ( word -- coverage )
M: word <word-help-coverage>
dup [ missing-sections ] [ empty-examples? ] bi
- 2dup 2array { { } f } =
+ 2dup [ empty? ] bi@ and
word-help-coverage boa ; inline
M: string <word-help-coverage>