Wiki

root/cobra/trunk/Tests/100-basics/040-assert.cobra

Revision 1542, 320 bytes (checked in by Chuck.Esterbrook, 4 years ago)

* Fixed: Assignments can be used in assert conditions even though they might be excluded during compilation or run-time. ticket:4 (hopscc)

  • Property svn:eol-style set to native
Line 
1namespace Test
2    class Test
3        def main
4            is shared
5            assert true
6            assert 1
7            assert -1
8            assert 1.0
9            assert 'test'.length
10
11            assert true, 'info'
12            assert true, true
13            assert true, 1
14
15            a = 'MyString'
16            assert a  # .warning. This assertion is always true
17
18            CobraCore.willCheckAssert = false
19            assert false
Note: See TracBrowser for help on using the browser.