Nice/testsuite/compiler/designByContract assert.testsuite,1.4,1.5

Artem Gr Kozarezov <[email protected]> Sat, 02 Apr 2005 09:14:26 +0000
Newsgroups gmane.comp.lang.nice.cvs
Message-ID <[email protected]>
Update of /cvsroot/nice/Nice/testsuite/compiler/designByContract
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23393/testsuite/compiler/designByContract

Modified Files:
	assert.testsuite 
Log Message:
Forced assertions (RFE 1153220) and automatic assertion message.

Index: assert.testsuite
===================================================================
RCS file: /cvsroot/nice/Nice/testsuite/compiler/designByContract/assert.testsuite,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** assert.testsuite	7 Feb 2005 15:41:56 -0000	1.4
--- assert.testsuite	2 Apr 2005 09:14:24 -0000	1.5
***************
*** 69,70 ****
--- 69,94 ----
      }
    }
+ 
+ /// PASS
+   // assertions have an automatic description
+   try{
+     assert 0 == 1;
+   }catch(AssertionFailed afe){
+     let message = afe.getMessage(); assert message != null;
+     assert message.indexOf( "==" ) != -1 : message;
+     assert message.indexOf( "main.nice" ) != -1 : message;
+   }
+ 
+ /// PASS
+   // forced assertions syntax
+   try{
+     !assert 0 == 1;
+     throw new Exception( "AssertionFailed not thrown." );
+   }catch(AssertionFailed ok){}
+ 
+ /// PASS
+   // optional assertions sytax
+   try{
+     ?assert 0 == 1;
+     throw new Exception( "AssertionFailed not thrown." );
+   }catch(AssertionFailed ok){}



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click