assert

Mark Wieder mwieder at ahsoftware.net
Sun Feb 23 12:01:53 EST 2014


Richmond-

May be better to try a simple but real example.
Here's a test that can be run on each new build of the engine to make
sure that the random() function hasn't broken.

on mouseUp
    test_random 5.3
    test_random 10.7
end mouseUp

on test_random x
    local y
    
    put random(x) into y
    # should return a positive integer
    assert y > 0
    # should round the upper limit
    assert y <= x
end test_random

on assertError a, b, c, d
    answer a, b, c, d
end assertError

-- 
-Mark Wieder
 ahsoftware at gmail.com

This communication may be unlawfully collected and stored by the National 
Security Agency (NSA) in secret. The parties to this email do not 
consent to the retrieving or storing of this communication and any 
related metadata, as well as printing, copying, re-transmitting, 
disseminating, or otherwise using it. If you believe you have received 
this communication in error, please delete it immediately.





More information about the use-livecode mailing list