% Script PRIVATETEST.m
Playground = tempname;
%Playground = "playground";
mkdir(Playground);
cd(Playground);
mkdir private;

% Create function foo.m on the fly
f = fopen("foo.m","wt");
fprintf(f,"\
function foo                   \n\
  disp('hello from foo!');     \n\
  baz                          \n\
endfunction                    \n\
");
fclose(f);

% Create private function baz.m on the fly
f = fopen("private/baz.m","wt");
fprintf(f,"\
function baz                   \n\
  disp('hello from baz!');     \n\
endfunction                    \n\
");
fclose(f);

% Run foo. This should fail if octave needs restarting for the private folder to become accessible
foo