]> git.xonotic.org Git - xonotic/gmqcc.git/blob - tests/truth.qc
add .gitignore file
[xonotic/gmqcc.git] / tests / truth.qc
1 void   print(...)   = #1;
2 string ftos (float) = #2;
3
4 void test(string s) {
5     print(ftos(!s));
6     if (s)   print(" on");
7     if (!s)  print(" off");
8     if (!!s) print(" !!on");
9     print("\n");
10 }
11
12 void test2(string s) {
13     print(ftos(!s));
14     while (s)   { print(" on");   break; }
15     while (!s)  { print(" off");  break; }
16     while (!!s) { print(" !!on"); break; }
17     print("\n");
18 }
19
20 string str_nul;
21
22 void main(vector v) {
23     test("foo");
24     test2("foo");
25     test("");
26     test2("");
27     test(str_nul);
28     test2(str_nul);
29 }