Project

General

Profile

Design #1496

Use "special" names for variables inside tests

Added by John Abbott over 3 years ago. Updated over 2 years ago.

Status:
In Progress
Priority:
Low
Assignee:
-
Category:
enhancing/improving
Target version:
Start date:
02 Oct 2020
Due date:
% Done:

10%

Estimated time:
Spent time:

Description

To avoid problems with name clashes the names of variables inside test scripts these variable should have "special" names (which are unlikely to clash).

Discuss, implement.


Related issues

Related to CoCoA-5 - Bug #1294: CoCoA-5 tests may fail even if executed correctlyClosed2019-06-06

History

#1 Updated by John Abbott over 3 years ago

  • Related to Bug #1294: CoCoA-5 tests may fail even if executed correctly added

#2 Updated by John Abbott over 3 years ago

COPIED FROM COMMENT 3 in #1294

One possibility is simply to use names which start with underscore: this is allowed and was used in CoCoA4 for something (hidden package values?).
Perhaps even double underscore? That would be quite unusual but not impinge too badly on readability.

It might be nicer to use names which depend on the test file: e.g. in exbugs.cocoa5 we could use names like exbug_f. This reduces the chance of a name clash, but also reduces readability.

#3 Updated by John Abbott over 3 years ago

Here is a list of the tests: we can remove the ones which have been checked/updated.

anna.cocoa5
AnonFunc.cocoa5
bug-EvalTwice.cocoa5
demo-GeMiTo2011.cocoa5
demo-Osaka2015.cocoa5
ErrMesg.cocoa5
exbugs.cocoa5
exsegv.cocoa5
ExtLibNORMALIZ.cocoa5
INACTIVE-packages.cocoa5
INACTIVE-parameters.cocoa5
INACTIVE-protection.cocoa5
lecture-HF1.cocoa5
lecture-HF2.cocoa5
lecture-HF3.cocoa5
lecture-HF4.cocoa5
primary.cocoa5
quine.cocoa5
radical0dim.cocoa5
radical.cocoa5
RealRoots.cocoa5
SourceAnna.cocoa5
tagging.cocoa5
test-ApproxSolve.cocoa5
test-FactorAlgExt.cocoa5
test-HomomorphismOps.cocoa5
test-implicit.cocoa5
test-manual.cocoa5
test-output.cocoa5
test-PrimaryDecomposition0.cocoa5
test-toric.cocoa5
tricky-references.cocoa5
tut-CoCoLA1.cocoa5
tut-CoCoLA2.cocoa5
tut-CoCoLA3.cocoa5
tut-CoCoLA4.cocoa5
TutHokkaido2.cocoa5
TutHokkaido3.cocoa5
TutHokkaido4.cocoa5
TutHokkaido5.cocoa5
whatiscocoa.cocoa5

#4 Updated by John Abbott over 2 years ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 10

I have decided to "test" the idea of putting a single underscore at the start of names.

I have just modified bug-EvalTwice.cocoa5 so that we can see how a test using "funny names" looks (and how readable it is).
Will check in shortly.

#5 Updated by John Abbott over 2 years ago

  • Priority changed from Normal to Low
  • Target version changed from CoCoA-5.4.0 to CoCoA-5.4.2
Anna is reasonably convinced by the idea. She made some alternative proposals:
  • use all capital letters for names which could in principle clash
  • use another prefix e.g. TEST_
  • change file names so that they are more uniform: e.g. prefixes such as Lecture, Test etc.

Priority is now low; target now 5.3.6.... this issue is not really urgent (no problems have ever been encountered).

Also available in: Atom PDF