-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve obsolete to support multiple levels
Obsolete warnings of level 1 will be displayed by default. Obsolete declarations taken an optional argument to set obsolete level (which defaults to 2). Obsolete warnings are now only printed once per obsolete function.
- Loading branch information
1 parent
0672c46
commit b575234
Showing
5 changed files
with
106 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
gap> START_TEST("obsolete.tst"); | ||
gap> newfunc:=function() return 42; end; | ||
function( ) ... end | ||
gap> DeclareObsoleteSynonym("obsoletetestfunc","newfunc",1); | ||
gap> DeclareObsoleteSynonym("obsoletetestfunc2","newfunc",2); | ||
gap> DeclareObsoleteSynonym("obsoletetestfunc3","newfunc",2); | ||
gap> oldLevel := InfoLevel(InfoObsolete);; | ||
gap> SetInfoLevel(InfoObsolete,1); | ||
gap> obsoletetestfunc(); | ||
#I 'obsoletetestfunc' is obsolete. | ||
#I It may be removed in a future release of GAP. | ||
#I Use newfunc instead. | ||
42 | ||
gap> obsoletetestfunc(); | ||
42 | ||
gap> obsoletetestfunc2(); | ||
42 | ||
gap> obsoletetestfunc2(); | ||
42 | ||
gap> SetInfoLevel(InfoObsolete, 2); | ||
gap> obsoletetestfunc2(); | ||
#I 'obsoletetestfunc2' is obsolete. | ||
#I It may be removed in a future release of GAP. | ||
#I Use newfunc instead. | ||
42 | ||
gap> obsoletetestfunc2(); | ||
42 | ||
gap> obsoletetestfunc3(); | ||
#I 'obsoletetestfunc3' is obsolete. | ||
#I It may be removed in a future release of GAP. | ||
#I Use newfunc instead. | ||
42 | ||
gap> obsoletetestfunc3(); | ||
42 | ||
gap> DeclareObsoleteSynonymAttr("obsoleteattr", "IsEmpty"); | ||
gap> obsoleteattr([1,2,3]); | ||
#I 'obsoleteattr' is obsolete. | ||
#I It may be removed in a future release of GAP. | ||
#I Use IsEmpty instead. | ||
false | ||
gap> obsoleteattr([1,2,3]); | ||
false | ||
gap> obsoleteattr([]); | ||
true | ||
gap> Hasobsoleteattr([]); | ||
#I 'Hasobsoleteattr' is obsolete. | ||
#I It may be removed in a future release of GAP. | ||
#I Use HasIsEmpty instead. | ||
true | ||
gap> Hasobsoleteattr([]); | ||
true | ||
gap> Setobsoleteattr([], true); | ||
#I 'Setobsoleteattr' is obsolete. | ||
#I It may be removed in a future release of GAP. | ||
#I Use SetIsEmpty instead. | ||
gap> SetInfoLevel(InfoObsolete, oldLevel); | ||
gap> STOP_TEST("obsolete.tst"); |