Permalink
Browse files

ENH: show search path

  • Loading branch information...
nno committed Sep 17, 2017
1 parent b185f13 commit 35f47e252da350e94fce60300d2c141edfab7201
Showing with 15 additions and 3 deletions.
  1. +9 −3 mvpa/cosmo_wtf.m
  2. +6 −0 tests/test_wtf.m
View
@@ -87,8 +87,8 @@
param2func=get_param2func();
if ~isfield(param2func,key)
error('Unsupported parameter ''%s''. Supported are: %s',...
key, cosmo_strjoin(fieldnames(param2func),', '));
error('Unsupported parameter ''%s''. Supported are:\n ''%s''',...
key, cosmo_strjoin(fieldnames(param2func),'''\n '''));
end
f=param2func.(key);
s=f();
@@ -102,13 +102,14 @@
cached_param2func.computer=@computer_;
cached_param2func.environment=@environment;
cached_param2func.version=version_;
cached_param2func.version_number=@version_number_;
cached_param2func.java=java_;
cached_param2func.cosmo_externals=@cosmo_externals;
cached_param2func.toolboxes=@toolboxes;
cached_param2func.warnings=@warning_helper;
cached_param2func.cosmo_config=@cosmo_config_helper;
cached_param2func.version_number=@version_number_;
cached_param2func.cosmo_files=@cosmo_files;
cached_param2func.path=@path_;
end
param2func=cached_param2func;
@@ -188,6 +189,9 @@
s=caught_error.message;
end
function s=path_()
s=cosmo_strsplit(path(),pathsep());
function parts=warning_helper()
s=warning();
n=numel(s);
@@ -222,3 +226,5 @@
ww{pos}=formatter(dk);
end
s=cosmo_strjoin(ww(1:pos),'\n');
View
@@ -78,6 +78,12 @@ function test_wtf_cosmo_externals()
s=cosmo_wtf('cosmo_externals');
assert(iscellstr(s));
function test_wtf_path()
s=cosmo_wtf('path');
assert(iscellstr(s));
p=path();
assertEqual(cosmo_strjoin(s,pathsep()),p);
function assert_contains(haystack, needle)
assert_contains_helper(haystack, needle, true);

0 comments on commit 35f47e2

Please sign in to comment.