]> gitweb.factorcode.org Git - factor.git/blob - extra/c/preprocessor/preprocessor-tests.factor
da5c574b5c1a26cde538995054b189d1e7e12372
[factor.git] / extra / c / preprocessor / preprocessor-tests.factor
1 ! Copyright (C) 2009 Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: tools.test c.preprocessor kernel accessors multiline
4 nested-comments ;
5 IN: c.preprocessor.tests
6
7 [ "vocab:c/tests/test1/test1.c" start-preprocess-file ]
8 [ include-nested-too-deeply? ] must-fail-with
9
10 [ "yo\n\n\n\nyo4\n" ]
11 [ "vocab:c/tests/test2/test2.c" start-preprocess-file nip ] unit-test
12
13 (*
14 [ "vocab:c/tests/test3/test3.c" start-preprocess-file ]
15 [ "\"BOO\"" = ] must-fail-with
16 *)
17
18 [ V{ "\"omg\"" "\"lol\"" } ]
19 [ "vocab:c/tests/test4/test4.c" start-preprocess-file drop warnings>> ] unit-test
20
21
22 (*
23 f(2 * (y+1)) + f(2 * (f(2 * (z[0])))) % f(2 * (0)) + t(1);
24 f(2 * (2+(3,4)-0,1)) | f(2 * (~ 5)) & f(2 * (0,1))^m(0,1);
25 int i[] = { 1, 23, 4, 5, };
26 char c[2][6] = { "hello", "" };
27 *)