Exemplo n.º 1
0
contract.test_preassert(1, 2)
try:
    contract.test_preassert(-1, 3)
    raise Exception("Failed! Preassertions are broken")
except RuntimeError:
    pass

contract.test_postassert(3)
try:
    contract.test_postassert(-3)
    raise Exception("Failed! Postassertions are broken")
except RuntimeError:
    pass

contract.test_prepost(2, 3)
contract.test_prepost(5, -4)
try:
    contract.test_prepost(-3, 4)
    raise Exception("Failed! Preassertions are broken")
except RuntimeError:
    pass

try:
    contract.test_prepost(4, -10)
    raise Exception("Failed! Postassertions are broken")

except RuntimeError:
    pass

f = contract.Foo()
Exemplo n.º 2
0
contract.test_preassert(1,2)
try:
	contract.test_preassert(-1)
	print "Failed! Preassertions are broken"
except:
	pass

contract.test_postassert(3)
try:
	contract.test_postassert(-3)
	print "Failed! Postassertions are broken"
except:
	pass

contract.test_prepost(2,3)
contract.test_prepost(5,-4)
try:
	contract.test_prepost(-3,4)
	print "Failed! Preassertions are broken"
except:
	pass

try:
	contract.test_prepost(4,-10)
	print "Failed! Postassertions are broken"

except:
	pass

f = contract.Foo()