FKlie / Predicata

GAP package Predicata: Deciding Presburger arithmetic using automata theory
http://www.algebra.uni-linz.ac.at/~kliemann/Predicata/
GNU General Public License v3.0
0 stars 1 forks source link

Restructuring tests #6

Open olexandr-konovalov opened 5 years ago

olexandr-konovalov commented 5 years ago

The default test file, specified in PackageInfo.g, is tst.g which is a GAP input file. I run it, and it seems to work:

gap> TestPackage("predicata");

Reading tst.g
Predicaton: deterministic finite automaton on 2 letters with 5 states, the variable position list [ 1 ] and the following tran\
sitions:
         |  1  2  3  4  5  
---------------------------
  [ 0 ]  |  4  2  2  3  5  
  [ 1 ]  |  2  2  5  2  2  
 Initial states: [ 1 ]
 Final states:   [ 5 ]

 The alphabet corresponds to the following variable list: [ "x" ].

 Regular expression of the Automaton:
   [ 0 ][ 0 ][ 1 ][ 0 ]*

 Output:
Predicaton: deterministic finite automaton on 4 letters with 5 states, the variable position list [ 1, 2 ] and the following t\
ransitions:
            |  1  2  3  4  5  
------------------------------
  [ 0, 0 ]  |  2  2  2  3  5  
  [ 1, 0 ]  |  2  2  5  2  2  
  [ 0, 1 ]  |  4  2  2  2  2  
  [ 1, 1 ]  |  2  2  2  2  2  
 Initial states: [ 1 ]
 Final states:   [ 5 ]

...
...
...

Predicaton: deterministic finite automaton on 1 letter with 1 state, the variable position list [ ] and the following transiti\
ons:
       |  1  
-------------
  [ ]  |  1  
 Initial states: [ 1 ]
 Final states:   [ 1 ]

 Regular expression of the Automaton:
   [ ]*

 Due to the Automaton/regular expression the formula is true.
   true

 Output:
Predicaton: deterministic finite automaton on 1 letter with 1 state, the variable position list [ ] and the following transiti\
ons:
       |  1  
-------------
  [ ]  |  1  
 Initial states: [ 1 ]
 Final states:   [ 1 ]

 Regular expression of the Automaton:
   [ ]*

 Due to the Automaton/regular expression the formula is true.
   true

 Output:

Finished tst.g

The difficulty is that unless you're the author of the package or an expert in this area, it's impossible to judge whether the long output is correct or not. For example, what is the meaning of the lines like

 Output:

Even for an author/expert, there is a chance that an error will be overlooked because it will be lost in many lines of output.

Hence, we recommend to use a different setup, documented in https://www.gap-system.org/Manuals/doc/ref/chap76.html#X85CA2F547CF87666. Please see ?TestPackage, ?Tests files for a GAP package and also ?TestDirectory for more information. You can find a sample setup in the example package at https://github.com/gap-packages/example. There is also a way to extract examples from XML source of the manual on fly - we can talk about this later.

FKlie commented 5 years ago

Removed Output:. I'll set up some new test file.

FKlie commented 5 years ago

Added testall.g and introduction.tst. TestPackage("predicata"); works for me.

fingolfin commented 5 years ago

With PR #8, it also works for me.