- Run all tests:
Results = RunTests()
- Run a single test:
run( DoubleDoubleTest( 'TestMethodName' ) )
Example:run( DoubleDoubleTest( 'TestConstructorScalar' ) )
- Spacing: Space after opening brackets and before closing brackets
- Correct:
[ 1, 2, 3 ]
andfunction Test( Arg )
- Incorrect:
[1, 2, 3]
orfunction Test(Arg)
- Correct:
- Operators: Always surrounded by spaces:
A + B
, notA+B
- Array indexing: Always use spaces:
A( 1 )
, notA(1)
- Exception: Use
(:)
without spaces
- Exception: Use
- Naming:
- Variables: PascalCase for vars longer than 2 letters
- Functions: PascalCase (TestConstructorEmpty, not testConstructorEmpty)
- Include header comments with function purpose and parameters
- Follow MATLAB's OOP syntax:
ToSumOfDoubles( A )
notA.ToSumOfDoubles()
- Use appropriate tolerances for numerical comparisons:
AbsTol = 1e-30
andRelTol = 1e-15