]> Nishi Git Mirror - gwion.git/commitdiff
add some tests
authorfennecdjay <astor.jeremie@wanadoo.fr>
Sun, 10 Mar 2019 23:28:36 +0000 (00:28 +0100)
committerfennecdjay <astor.jeremie@wanadoo.fr>
Sun, 10 Mar 2019 23:28:36 +0000 (00:28 +0100)
tests/new/break.gw [new file with mode: 0644]
tests/new/float.gw [new file with mode: 0644]
tests/new/pure.gw [new file with mode: 0644]
tests/new/spork.gw
tests/new/spork2.gw [new file with mode: 0644]
tests/new/spork_in_func.gw [new file with mode: 0644]
tests/new/spork_rec.gw [new file with mode: 0644]
tests/new/static.gw [new file with mode: 0644]

diff --git a/tests/new/break.gw b/tests/new/break.gw
new file mode 100644 (file)
index 0000000..fb4a5da
--- /dev/null
@@ -0,0 +1,13 @@
+fun void t(int i) {
+   <<<i>>>;
+  if(!i)
+    1/i;
+  <<<"id: ", (spork t(i-1)).id()>>>;
+  me.yield();
+//samp => now;
+}
+10 => t;
+//me.yield();
+second => now;
+me.yield();
+<<<"end">>>;
diff --git a/tests/new/float.gw b/tests/new/float.gw
new file mode 100644 (file)
index 0000000..7143539
--- /dev/null
@@ -0,0 +1,5 @@
+class C {
+  1 => float f;
+}
+C c;
+<<<c.f>>>;
diff --git a/tests/new/pure.gw b/tests/new/pure.gw
new file mode 100644 (file)
index 0000000..cd6b8ef
--- /dev/null
@@ -0,0 +1,3 @@
+fun int pure(int i) { return i; }
+2 => pure;
+2 => pure;
index 9ce4a9787cb6c98f08b7da792b50571d6cad4514..81e571fc2c83416b2e5fed87cc887b2fc8fd7552 100644 (file)
@@ -1,8 +1,12 @@
-int i;
-spork { <<<"test">>>; };
-me.yield();
-//samp => now;
-fun void t() { <<<__func__>>>; }
+fun void _t() { <<<__func__>>>; }
+fun int t() {
+//<<<1>>>;
+  spork _t();
+
+ spork \a{ <<<__func__, " ", a>>>; }(1);
+
+ spork { <<<__func__>>>; };
+}
 spork t();
+t();
 me.yield();
-samp => now;
diff --git a/tests/new/spork2.gw b/tests/new/spork2.gw
new file mode 100644 (file)
index 0000000..ef8814b
--- /dev/null
@@ -0,0 +1,27 @@
+fun void _t() { <<<__func__>>>; }
+class C {
+<<<this>>>;
+fun void __t() { <<<__func__>>>; }
+fun void __t(int i) { <<<this, " ", __func__, " ", i>>>; }
+fun void t() {
+  spork _t();
+  spork _t();
+  spork this.__t();
+  spork __t();
+<<<this>>>;
+  spork __t(2);
+me.yield();
+  spork \{ <<<" " , __func__>>>; }();
+
+  spork \a{ <<<__func__, " ", a>>>; }(1);
+
+ spork { <<<__func__>>>; };
+}
+spork t();
+spork t();
+t();
+t();
+me.yield();
+}
+<<<C c>>>;
+me.yield();
diff --git a/tests/new/spork_in_func.gw b/tests/new/spork_in_func.gw
new file mode 100644 (file)
index 0000000..a6835f1
--- /dev/null
@@ -0,0 +1,8 @@
+function void test() {
+//  <<<1>>>;
+//spork \{<<<2>>>;}();
+}
+test(); 
+test(); 
+<<<"end">>>;
+me.yield();
diff --git a/tests/new/spork_rec.gw b/tests/new/spork_rec.gw
new file mode 100644 (file)
index 0000000..4ecaf78
--- /dev/null
@@ -0,0 +1,6 @@
+fun void t(int i) {
+  if(i)
+    spork t(i-1);
+}
+t(3);
+me.yield();
diff --git a/tests/new/static.gw b/tests/new/static.gw
new file mode 100644 (file)
index 0000000..d16d65b
--- /dev/null
@@ -0,0 +1,4 @@
+class C { fun static C t() { C c; <<<c, "  something">>>; 
+return c; } }
+//C c;
+<<<C.t()>>>;