Permalink
Browse files

add tests for boolean and bitwise ops

  • Loading branch information...
1 parent 10c4576 commit 8f5269fffcc4a9226459e82abfaff434c27f97e9 @samsonjs committed Feb 15, 2010
Showing with 26 additions and 1 deletion.
  1. +11 −1 test/Makefile
  2. +5 −0 test/test_and.code
  3. +5 −0 test/test_bit_ops.code
  4. +5 −0 test/test_or.code
View
@@ -11,7 +11,7 @@ ifeq ($(BINFORMAT), bin)
@echo " Your platform, " $(PLATFORM) ", is unsupported."
endif
-all: lt gt ge le eq neq if while until repeat for do break print big huge
+all: lt gt ge le eq neq or and if while until repeat for do break print big huge
@true
lt: test.rb test_lt.code
@@ -62,10 +62,20 @@ big: test.rb test_big.code
huge: test.rb test_huge.code
@./test.rb huge $(BINFORMAT)
+or: test.rb test_or.code
+ @./test.rb or $(BINFORMAT)
+
+and: test.rb test_and.code
+ @./test.rb and $(BINFORMAT)
+
+bit_ops: test.rb test_bit_ops.code
+ @./test.rb bit_ops $(BINFORMAT)
+
clean:
@rm -f test*.asm test*.o
@rm -f test_big test_lt test_gt test_ge test_le test_eq test_neq
@rm -f test_while test_if test_until test_repeat test_do
@rm -f test_for test_break test_print test_huge
+ @rm -f test_and test_or test_bit_ops
.PHONY: clean
View
@@ -0,0 +1,5 @@
+a = 0 && 0
+b = 0 && 1
+c = 1 && 0
+d = 1 && 1
+exit_code = !(a == 0 && b == 0 && c == 0 && d)
@@ -0,0 +1,5 @@
+a = 4 | 7 # 7
+b = 4 ^ 7 # 3
+c = 4 & 7 # 4
+exitcode = a - b - c
+
View
@@ -0,0 +1,5 @@
+a = 0 || 0
+b = 0 || 1
+c = 1 || 0
+d = 1 || 1
+exit_code = !(a ==0 && b && c && d)

0 comments on commit 8f5269f

Please sign in to comment.