1 ! (c)2009 Joe Groff bsd license
2 USING: accessors alien.c-types alien.parser alien.syntax
3 tools.test vocabs.parser parser ;
11 "alien.parser.tests" use-vocab
12 "alien.c-types" use-vocab
14 [ int ] [ "int" parse-c-type ] unit-test
15 [ { int 5 } ] [ "int[5]" parse-c-type ] unit-test
16 [ { int 5 10 11 } ] [ "int[5][10][11]" parse-c-type ] unit-test
17 [ void* ] [ "int*" parse-c-type ] unit-test
18 [ void* ] [ "int**" parse-c-type ] unit-test
19 [ void* ] [ "int***" parse-c-type ] unit-test
20 [ void* ] [ "int****" parse-c-type ] unit-test
21 [ char* ] [ "char*" parse-c-type ] unit-test
22 [ void* ] [ "char**" parse-c-type ] unit-test
23 [ void* ] [ "char***" parse-c-type ] unit-test
24 [ void* ] [ "char****" parse-c-type ] unit-test
25 [ char2 ] [ "char2" parse-c-type ] unit-test
26 [ char* ] [ "char2*" parse-c-type ] unit-test
28 [ "not-c-type" parse-c-type ] [ no-c-type? ] must-fail-with
29 [ "not-word" parse-c-type ] [ error>> no-word-error? ] must-fail-with