[Nice-commit] Nice/testsuite/compiler/expressions/operators comparison.testsuite,1.1,1.2
Brought to you by:
bonniot
|
From: <bo...@us...> - 2003-04-02 16:58:57
|
Update of /cvsroot/nice/Nice/testsuite/compiler/expressions/operators
In directory sc8-pr-cvs1:/tmp/cvs-serv27729/testsuite/compiler/expressions/operators
Modified Files:
comparison.testsuite
Log Message:
Repeated comparison operators should all be in the same direction: either
< and <=, or > and >=.
Sub-expressions should not be computed several times.
Index: comparison.testsuite
===================================================================
RCS file: /cvsroot/nice/Nice/testsuite/compiler/expressions/operators/comparison.testsuite,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** comparison.testsuite 14 Dec 2002 12:28:06 -0000 1.1
--- comparison.testsuite 2 Apr 2003 16:58:52 -0000 1.2
***************
*** 3,5 ****
--- 3,17 ----
/// PASS
+ assert 0 <= 0 <= 2;
+
+ /// PASS
assert ! (0 < 2 < 1);
+
+ /// FAIL bug
+ boolean b = 1 > 0 < 2;
+
+ /// PASS bug
+ int nbUses = 0;
+ byte b() { nbUses++; return 1; }
+ boolean b = 0 < b() < 2L;
+ assert nbUses == 1;
|