Skip to content
Browse files

a bunch of new and moved test

  • Loading branch information...
1 parent ab1ef85 commit 1b87089d80c54adb283f225ca61af395490f00c5 @NotFound committed
Showing with 68 additions and 5 deletions.
  1. +3 −1 Makefile
  2. +30 −0 t/base/02bitwiseops.t
  3. +20 −0 t/base/02opsub.t
  4. +15 −0 t/base/06localfunctions.t
  5. +0 −4 t/base/features.t
View
4 Makefile
@@ -110,8 +110,10 @@ winxedxc.pbc: winxedxc.pir
#-----------------------------------------------------------------------
TESTS = t/base/00test.t \
- t/base/02opadd.t t/base/02opmul.t \
+ t/base/02opadd.t t/base/02opmul.t t/base/02opsub.t \
+ t/base/02bitwiseops.t \
t/base/03pmc.t t/base/03class.t \
+ t/base/06localfunctions.t \
t/base/features.t
test: winxedxx.pbc $(FRONTEND) winxedxx.h $(LIB)
View
30 t/base/02bitwiseops.t
@@ -0,0 +1,30 @@
+#! winxed
+
+// winxedxx base tests
+// bitwise operators
+
+using extern Test.More plan, is;
+
+function main [main] (var args)
+{
+ plan(7);
+
+ int a = 7;
+ int b = 3;
+ is(a & b, 3, "7 & 3 : 3");
+ is(a & ~b, 4, "7 & ~ 3 : 4");
+ a= 6;
+ is(a & b, 2, "6 & 3 : 2");
+ b= 1;
+ is(a & b, 0, "6 & 1 : 0");
+
+ a = 7;
+ b = 3;
+ is(a | b, 7, "7 | 3 : 7");
+ a= 17;
+ is(a | b, 19, "17 | 3 : 19");
+ b= 11;
+ is(a | b, 27, "17 | 11 : 27");
+}
+
+// End
View
20 t/base/02opsub.t
@@ -0,0 +1,20 @@
+#! winxed
+
+// winxedxx base tests
+// operator -
+
+using extern Test.More plan, is;
+
+function main [main] (var args)
+{
+ plan(3);
+
+ int i = 42;
+ var vi1 = i;
+
+ is(i - 2, 40, "int - int");
+ is(i - vi1, 0, "int - var");
+ is(vi1 - i, 0, "var - int");
+}
+
+// End
View
15 t/base/06localfunctions.t
@@ -0,0 +1,15 @@
+#! winxed
+
+// winxedxx base tests
+// local functions
+
+using extern Test.More plan, is;
+
+function main [main] (var args)
+{
+ plan(1);
+ var f = function () { return 42; };
+ is(f(), 42, "define and call a local function");
+}
+
+// End
View
4 t/base/features.t
@@ -321,10 +321,6 @@ function main [main] (args)
is(str + vi1, "2.542", "string + var");
is(vi1 + str, "422.5", "var + string");
- is(i - 2, 40, "int - int");
- is(i - vi1, 0, "int - var");
- is(vi1 - i, 0, "var - int");
-
string s = "abc";
is(s * 3, "abcabcabc", "repeat string");

0 comments on commit 1b87089

Please sign in to comment.
Something went wrong with that request. Please try again.