1 ! (c)2009 Joe Groff bsd license
2 USING: accessors alien.c-types alien.parser alien.syntax
3 tools.test vocabs.parser ;
8 [ int ] [ "int" parse-c-type ] unit-test
9 [ { int 5 } ] [ "int[5]" parse-c-type ] unit-test
10 [ { int 5 10 11 } ] [ "int[5][10][11]" parse-c-type ] unit-test
11 [ void* ] [ "int*" parse-c-type ] unit-test
12 [ void* ] [ "int**" parse-c-type ] unit-test
13 [ void* ] [ "int***" parse-c-type ] unit-test
14 [ void* ] [ "int****" parse-c-type ] unit-test
15 [ char* ] [ "char*" parse-c-type ] unit-test
16 [ void* ] [ "char**" parse-c-type ] unit-test
17 [ void* ] [ "char***" parse-c-type ] unit-test
18 [ void* ] [ "char****" parse-c-type ] unit-test
19 [ char2 ] [ "char2" parse-c-type ] unit-test
20 [ char* ] [ "char2*" parse-c-type ] unit-test
24 [ "not-c-type" parse-c-type ] [ no-c-type? ] must-fail-with
25 ! uncomment this when string C type parsing goes away
26 ! [ "not-word" parse-c-type ] [ error>> no-word-error? ] must-fail-with