Skip to content

Commit

Permalink
document that tests should clean up after themselves
Browse files Browse the repository at this point in the history
Fixes #117.  Fixes #183.
  • Loading branch information
cbm755 committed Feb 26, 2019
1 parent 698e57f commit 5f207e1
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions inst/doctest.m
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,20 @@
%% @end group
%% @end example
%%
%% If your test changes the global state (e.g., @code{format} or
%% @code{chdir}), you may need to undo your changes afterwards.
%% In this example, we followup with @code{format} to reset to the
%% default five digits:
%%
%% @example
%% @group
%% >> format long
%% >> 355/113
%% ans = 3.14159292035...
%% >> format
%% @end group
%% @end example
%%
%%
%% @strong{Diary Style}
%% When the m-file contains plaintext documentation, doctest finds tests
Expand Down

0 comments on commit 5f207e1

Please sign in to comment.