Project

General

Profile

Support #286

How to test (automatically) a user defined CoCoA function

Added by Anna Maria Bigatti over 11 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Normal
Category:
Manual/documentation
Target version:
Start date:
11 Dec 2012
Due date:
% Done:

100%

Estimated time:
Spent time:

Description

When developing and changing a cocoa function it is useful to repeatedly run some tests.
Explain how to do this easily.


Related issues

Related to CoCoA-5 - Support #251: How to add a test for CoCoA-5 (CoCoAInterpreter)Closed2012-10-02

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

Also available in: Atom PDF