view test/publish/publish.tst @ 22113:b6f482e29afd

New functions publish.m and grabcode.m (patch #9048). * scripts/general/module.mk: Add entries for the new funtions. * scripts/general/grabcode.m: New function. * scripts/general/publish.m: New function. * scripts/general/private/__publish_html_output__.m: New function. * scripts/general/private/__publish_latex_output__.m: New function. * scripts/help/__unimplemented__.m: Remove entries publish and grabcode. * NEWS: Announce new functions. * doc/interpreter/func.txi: Add documentation for the new functions. * test/module.mk: New entry for test module publish. * test/publish/module.mk: New entries for publish tests. * test/publish/publish.tst: New test file, to run all test scripts on publish and grabcode. * test/publish/test_script.m: New test script. * test/publish/test_script_code_only.m: New test script. * test/publish/test_script_empty.m: New test script. * test/publish/test_script_example.m: New test script. * test/publish/test_script_head_only.m: New test script.
author Kai T. Ohlhus <k.ohlhus@gmail.com>
date Fri, 15 Jul 2016 11:46:16 +0200
parents
children 8971508e21c8
line wrap: on
line source

## publish

%!testif HAVE_X_WINDOWS
%! cases = dir ("test_script*.m");
%! cases = strsplit (strrep ([cases.name], ".m", ".m\n"));
%! for i = 1:length(cases)-1
%!   publish (cases{i});
%! endfor
%! confirm_recursive_rmdir (false, "local");
%! rmdir ("html", "s");

## grabcode

%!testif HAVE_X_WINDOWS
%! publish ("test_script.m");
%! str1 = fileread ("test_script.m");
%! str2 = grabcode ("html/test_script.html");
%! confirm_recursive_rmdir (false, "local");
%! rmdir ("html", "s");
%! # Canonicalize strings
%! str1 = strjoin (deblank (strsplit (str1, "\n")), "\n");
%! str2 = strjoin (deblank (strsplit (str2, "\n")), "\n");
%! assert (hash ("md5", str1), hash ("md5", str2));