X-Git-Url: https://gitweb.factorcode.org/gitweb.cgi?p=factor.git;a=blobdiff_plain;f=extra%2Flint%2Fvocabs%2Fvocabs-tests.factor;h=61e5ffa29fb8d44e5c56a00c6f138312d0eef5d9;hp=b73c0167ca5c3d1dccf9a85f11f13acd2ca68e61;hb=c0a790904791be6f356a0a5737fad17e8aeaeb6f;hpb=ba6e4972de6558b342ad9f0027b555bb885af62f diff --git a/extra/lint/vocabs/vocabs-tests.factor b/extra/lint/vocabs/vocabs-tests.factor index b73c0167ca..61e5ffa29f 100644 --- a/extra/lint/vocabs/vocabs-tests.factor +++ b/extra/lint/vocabs/vocabs-tests.factor @@ -30,17 +30,18 @@ USE: math.complex USE: math.primes " -CONSTANT: ignore-postpone-using "POSTPONE: USING: : nop ( -- ) ;" -CONSTANT: ingore-\-using "\\ USING: : nop ( -- ) ;" -CONSTANT: ignore-postpone-use "POSTPONE: USE: ignore : nop ( -- ) ;" -CONSTANT: ignore-\-use "\\ USE: ignore : nop ( -- ) ;" -CONSTANT: ignore-in-string-one "\"USE:\" \"USING:\" : nop ( -- ) ;" -CONSTANT: ignore-in-string-two "\"asdfasdf USE:\" \"asdfasdf USING:\" : nop ( -- ) ;" -CONSTANT: ignore-in-string-three "\"asdfasdf USE: asdfasdf\" : nop ( -- ) ;" -CONSTANT: ignore-in-string-four "\"asdfasdf USE: asdfasdf\" \"asdfasff USING: asdfasdf\" : nop ( -- ) ;" -CONSTANT: ignore-use-regex "R/ USE: ignore/ : nop ( -- ) ;" -CONSTANT: ignore-using-regex "R/ USING: ignore ;/ : nop ( -- ) ;" -CONSTANT: empty-using-statement "USING: ; nop ( -- ) ;" +CONSTANT: ignore-postpone-using "POSTPONE: USING: : nop ( -- ) ;" +CONSTANT: ingore-\-using "\\ USING: : nop ( -- ) ;" +CONSTANT: ignore-postpone-use "POSTPONE: USE: ignore : nop ( -- ) ;" +CONSTANT: ignore-\-use "\\ USE: ignore : nop ( -- ) ;" +CONSTANT: ignore-in-string-one "\"USE:\" \"USING:\" : nop ( -- ) ;" +CONSTANT: ignore-in-string-two "\"asdfasdf USE:\" \"asdfasdf USING:\" : nop ( -- ) ;" +CONSTANT: ignore-in-string-three "\"asdfasdf USE: asdfasdf\" : nop ( -- ) ;" +CONSTANT: ignore-in-string-four "\"asdfasdf USE: asdfasdf\" \"asdfasff USING: asdfasdf\" : nop ( -- ) ;" +CONSTANT: ignore-string-with-quote "\"\\\"USE:\" : nop ( -- ) ;" +CONSTANT: ignore-use-regex "R/ USE: ignore/ : nop ( -- ) ;" +CONSTANT: ignore-using-regex "R/ USING: ignore ;/ : nop ( -- ) ;" +CONSTANT: empty-using-statement "USING: ; nop ( -- ) ;" : ---- ( -- ) "-------------------------------------------------------------------------" print ; PRIVATE> @@ -59,20 +60,21 @@ PRIVATE> ---- "It should ignore USE: and USING: that are in strings: " print -{ { } } [ ignore-in-string-one find-unused-in-string ] unit-test -{ { } } [ ignore-in-string-two find-unused-in-string ] unit-test -{ { } } [ ignore-in-string-three find-unused-in-string ] unit-test -{ { } } [ ignore-in-string-four find-unused-in-string ] unit-test +{ { } } [ ignore-in-string-one find-unused-in-string ] unit-test +{ { } } [ ignore-in-string-two find-unused-in-string ] unit-test +{ { } } [ ignore-in-string-three find-unused-in-string ] unit-test +{ { } } [ ignore-in-string-four find-unused-in-string ] unit-test +{ { } } [ ignore-string-with-quote find-unused-in-string ] unit-test ---- "It should ignore USE: and USING: that are in RegEx: " print -{ { } } [ ignore-use-regex find-unused-in-string ] unit-test +{ { } } [ ignore-use-regex find-unused-in-string ] unit-test { { } } [ ignore-using-regex find-unused-in-string ] unit-test ---- -"IT should return empty when no imports have been found: " print +"It should return empty when no imports have been found: " print { { } } [ empty-using-statement find-unused-in-string ] unit-test ---- @@ -83,4 +85,4 @@ dictionary get clone 1array [ dictionary get clone ] unit-test ----- \ No newline at end of file +----