]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/lint/vocabs/vocabs-tests.factor
Fixed Regexp to Handle \" Properly
[factor.git] / extra / lint / vocabs / vocabs-tests.factor
index b73c0167ca5c3d1dccf9a85f11f13acd2ca68e61..61e5ffa29fb8d44e5c56a00c6f138312d0eef5d9 100644 (file)
@@ -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
+----