Support #286
How to test (automatically) a user defined CoCoA function
Status:
Closed
Priority:
Normal
Assignee:
Category:
Manual/documentation
Target version:
Description
When developing and changing a cocoa function it is useful to repeatedly run some tests.
Explain how to do this easily.
Related issues
History
#1 Updated by Anna Maria Bigatti over 11 years ago
- Category set to Manual/documentation
- Assignee set to Anna Maria Bigatti
- Target version set to CoCoA-5.0.9
- % Done changed from 0 to 50
I describe here an easy way to check a list of tests (from CoCoA-5/tests/anna.cocoa5
):
Define TEST_ASSERT(A,B) If A<>B Then error("TEST: " + Sprint(A) + " <> " + Sprint(B)); EndIf; EndDefine;
And here are some examples of testing: (FunctionCall, ExpectedResult)
TEST_ASSERT(sum([1,2,3]), 6); TEST_ASSERT(sum([],6), 6); TEST_ASSERT(product([1,2,3]), 6); TEST_ASSERT(product([],6), 6); .....
#2 Updated by Anna Maria Bigatti over 11 years ago
- Subject changed from testing cocoa functions to Testing (user defined) CoCoA functions
#3 Updated by Anna Maria Bigatti about 10 years ago
- Target version changed from CoCoA-5.0.9 to CoCoA-5.1.0 Easter14
#4 Updated by Anna Maria Bigatti about 10 years ago
- Status changed from New to In Progress
- Target version changed from CoCoA-5.1.0 Easter14 to CoCoA-5.1.1 Seoul14
#5 Updated by John Abbott over 9 years ago
- Status changed from In Progress to Closed
#6 Updated by John Abbott over 9 years ago
- % Done changed from 50 to 100
#7 Updated by Anna Maria Bigatti over 9 years ago
- Subject changed from Testing (user defined) CoCoA functions to How to test (automatically) a user defined CoCoA function