Skip to content

Commit

Permalink
Added test function to compare syntax trees
Browse files Browse the repository at this point in the history
  • Loading branch information
sebasguts committed Mar 18, 2019
1 parent 3e5f798 commit 67d1cbd
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tst/testinstall/syntaxtree.tst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ gap> SyntaxTree(x -> x);
gap> SyntaxTree(\+);
Error, SYNTAX_TREE: <func> must be a plain GAP function (not a function)

gap> test_tree := function( f )
> local curr_tree, new_func, new_tree;
> curr_tree := SYNTAX_TREE( f );
> new_func := SYNTAX_TREE_CODE( curr_tree );
> new_tree := SYNTAX_TREE( new_func );
> if new_tree <> curr_tree then
> Error( "trees are not equal" );
> fi;
> end;

# Just try compiling all functions we can find in the workspace
# to see nothing crashes.
gap> for n in NamesGVars() do
Expand Down

0 comments on commit 67d1cbd

Please sign in to comment.