]> git.xonotic.org Git - voretournament/voretournament.git/blobdiff - misc/source/gmqcc-src/tests/truth.qc
By fteqcc, hello gmqcc
[voretournament/voretournament.git] / misc / source / gmqcc-src / tests / truth.qc
diff --git a/misc/source/gmqcc-src/tests/truth.qc b/misc/source/gmqcc-src/tests/truth.qc
new file mode 100644 (file)
index 0000000..9df6217
--- /dev/null
@@ -0,0 +1,26 @@
+void test(string s) {
+    print(ftos(!s));
+    if (s)   print(" on");
+    if (!s)  print(" off");
+    if (!!s) print(" !!on");
+    print("\n");
+}
+
+void test2(string s) {
+    print(ftos(!s));
+    while (s)   { print(" on");   break; }
+    while (!s)  { print(" off");  break; }
+    while (!!s) { print(" !!on"); break; }
+    print("\n");
+}
+
+string str_nul;
+
+void main(vector v) {
+    test("foo");
+    test2("foo");
+    test("");
+    test2("");
+    test(str_nul);
+    test2(str_nul);
+}