! See http://factorcode.org/license.txt for BSD license.
USING: accessors arrays assocs compiler.units continuations
formatting hash-sets hashtables io io.encodings.utf8 io.files
-kernel namespaces regexp sequences sequences.deep sets sorting
-splitting tools.test unicode vocabs vocabs.loader ;
+kernel namespaces regexp sequences sequences.deep
+sequences.parser sets sorting splitting tools.test unicode
+vocabs vocabs.loader ;
IN: lint.vocabs
<PRIVATE
: ---- ( -- ) "-------------------------------------------------------------------------" print ;
PRIVATE>
+"next-token should get the next non-blank string in the stream:" print
+{ "hello" } [ "hello world!" <sequence-parser> next-token ] unit-test
+{ "hello" } [ "\n hello \n world! " <sequence-parser> next-token ] unit-test
+
+----
+
+"next-token should ignore comments:" print
+{ "world!" } [ "! hello\nworld!" <sequence-parser> next-token ] unit-test
+{ "world!" } [ "! h\n! e\n! l\n! l\n! o\nworld!" <sequence-parser> next-token ] unit-test
+
+----
+
"It should work on multiple lines, with multiple imports across the file: " print
{ { "hashtables" "math.primes" "sequences" "sets" "vocabs" } } [ mock-file find-unused-in-string ] unit-test