]> gitweb.factorcode.org Git - factor.git/commitdiff
alien.parser: fix unit tests
authorSlava Pestov <slava@shill.local>
Mon, 28 Sep 2009 10:42:41 +0000 (05:42 -0500)
committerSlava Pestov <slava@shill.local>
Mon, 28 Sep 2009 10:42:41 +0000 (05:42 -0500)
basis/alien/parser/parser-tests.factor

index b9ef08e890fdd183990b8696e87fbe59f4e8fe7c..195cbb78a238f0bfb6782ac079b7f027824d56f2 100644 (file)
@@ -1,27 +1,31 @@
 ! (c)2009 Joe Groff bsd license
 USING: accessors alien.c-types alien.parser alien.syntax
-tools.test vocabs.parser ;
+tools.test vocabs.parser parser ;
 IN: alien.parser.tests
 
 TYPEDEF: char char2
 
-[ int ] [ "int" parse-c-type ] unit-test
-[ { int 5 } ] [ "int[5]" parse-c-type ] unit-test
-[ { int 5 10 11 } ] [ "int[5][10][11]" parse-c-type ] unit-test
-[ void* ] [ "int*" parse-c-type ] unit-test
-[ void* ] [ "int**" parse-c-type ] unit-test
-[ void* ] [ "int***" parse-c-type ] unit-test
-[ void* ] [ "int****" parse-c-type ] unit-test
-[ char* ] [ "char*" parse-c-type ] unit-test
-[ void* ] [ "char**" parse-c-type ] unit-test
-[ void* ] [ "char***" parse-c-type ] unit-test
-[ void* ] [ "char****" parse-c-type ] unit-test
-[ char2 ] [ "char2" parse-c-type ] unit-test
-[ char* ] [ "char2*" parse-c-type ] unit-test
-
 SYMBOL: not-c-type
 
-[ "not-c-type" parse-c-type ] [ no-c-type? ] must-fail-with
-! uncomment this when string C type parsing goes away
-! [ "not-word" parse-c-type ] [ error>> no-word-error? ] must-fail-with
+[
+    "alien.parser.tests" use-vocab
+    "alien.c-types" use-vocab
+
+    [ int ] [ "int" parse-c-type ] unit-test
+    [ { int 5 } ] [ "int[5]" parse-c-type ] unit-test
+    [ { int 5 10 11 } ] [ "int[5][10][11]" parse-c-type ] unit-test
+    [ void* ] [ "int*" parse-c-type ] unit-test
+    [ void* ] [ "int**" parse-c-type ] unit-test
+    [ void* ] [ "int***" parse-c-type ] unit-test
+    [ void* ] [ "int****" parse-c-type ] unit-test
+    [ char* ] [ "char*" parse-c-type ] unit-test
+    [ void* ] [ "char**" parse-c-type ] unit-test
+    [ void* ] [ "char***" parse-c-type ] unit-test
+    [ void* ] [ "char****" parse-c-type ] unit-test
+    [ char2 ] [ "char2" parse-c-type ] unit-test
+    [ char* ] [ "char2*" parse-c-type ] unit-test
+
+    [ "not-c-type" parse-c-type ] [ no-c-type? ] must-fail-with
+    [ "not-word" parse-c-type ] [ error>> no-word-error? ] must-fail-with
 
+] with-file-vocabs
\ No newline at end of file