]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/alien/parser/parser-tests.factor
use a "pointer" wrapper tuple to indicate pointer types instead of the current slipsh...
[factor.git] / basis / alien / parser / parser-tests.factor
index 061deb84c5c5bc6115c71353f3db5dd164ce8a82..b7f7b106282e6ce2300d0e02d1a7f2def911767b 100644 (file)
@@ -8,6 +8,8 @@ TYPEDEF: char char2
 
 SYMBOL: not-c-type
 
+CONSTANT: eleven 11
+
 [
     "alien.parser.tests" use-vocab
     "alien.c-types" use-vocab
@@ -15,20 +17,17 @@ SYMBOL: not-c-type
     [ 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
+    [ { int 5 10 eleven } ] [ "int[5][10][eleven]" parse-c-type ] unit-test
+    [ pointer: void ] [ "void*" parse-c-type ] unit-test
+    [ pointer: int ] [ "int*" parse-c-type ] unit-test
+    [ pointer: int* ] [ "int**" parse-c-type ] unit-test
+    [ pointer: int** ] [ "int***" parse-c-type ] unit-test
+    [ pointer: int*** ] [ "int****" parse-c-type ] unit-test
+    [ pointer: char ] [ "char*" parse-c-type ] unit-test
     [ char2 ] [ "char2" parse-c-type ] unit-test
-    [ char* ] [ "char2*" parse-c-type ] unit-test
+    [ pointer: char2 ] [ "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
 
 ! Reported by mnestic
@@ -40,4 +39,4 @@ TYPEDEF: int alien-parser-test-int ! reasonably unique name...
         ! after restart, we end up here
         "OK!"
     ] [ :1 ] recover
-] unit-test
\ No newline at end of file
+] unit-test