]> gitweb.factorcode.org Git - factor.git/commitdiff
help.lint.coverage: Add yet another sanity test, clean up broken words after lint...
authorDoug Coleman <doug.coleman@gmail.com>
Sat, 7 Jul 2018 07:03:55 +0000 (02:03 -0500)
committerDoug Coleman <doug.coleman@gmail.com>
Sat, 7 Jul 2018 07:03:55 +0000 (02:03 -0500)
extra/help/lint/coverage/coverage-tests.factor

index 4c668b3889851829a0232d6d2d7fc32d37883ead..2c4421a3f398e28e7ddc17c854a7f4d5d17bb702 100644 (file)
@@ -1,7 +1,7 @@
-USING: accessors english help.lint.coverage
+USING: accessors english eval help.lint.coverage
 help.lint.coverage.private help.markup help.syntax kernel
-literals math math.matrices sequences sorting tools.test vocabs
-;
+literals math math.matrices multiline sequences sorting
+tools.test vocabs ;
 IN: help.lint.coverage.tests
 
 <PRIVATE
@@ -67,3 +67,33 @@ PRIVATE>
 ! 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
+
+
+! Lint system is written weirdly, there's no way to invoke it and get the output
+! Instead, it writes to lint-failures.
+{ }
+[
+    [[
+        USING: assocs math kernel namespaces help.syntax help.lint help.lint.private ;
+        IN: help.lint.tests
+        <<
+        : add-stuff ( x y -- z ) + ;
+
+        HELP: add-stuff ;
+        >>
+        H{ } clone lint-failures [ \ add-stuff check-word lint-failures get ] with-variable
+        assoc-empty? [ "help-lint is broken" throw ] when
+    ]] eval( -- )
+] unit-test
+
+
+! clean up broken words
+[[
+  USING: definitions ;
+  IN: help.lint.coverage.tests.private
+<<
+\ empty forget
+\ nonexistent forget
+\ defined forget
+>>
+]] eval( -- )
\ No newline at end of file