Actually, if you want to try writing a unit test, this function is perfect for it.
isntall the mox unit toolbox on your computer
create a tsv file with the some dummy content that the fucntion should read and filter (you can create and store it in a dummyData folder inside the tests directory.
write a unit test function in the tests folder (see below for a template)
function test_suite = test_readOutputFilter %#ok<*STOUT>
try % assignment of 'localfunctions' is necessary in Matlab >= 2016
test_functions = localfunctions(); %#ok<*NASGU>
catch % no problem; early Matlab versions can use initTestSuite fine
end
initTestSuite;
end
function test_readOutputFilterBasic()
%% set up
cfg = ... % fill in
filterHeader = ... % fill in
filterContent = ... % fill in
outputFiltered = readOutputFilter(cfg, filterHeader, filterContent)
%% test data
expectedOutput = ... % create a structure that describes what output you expect
%% test
assertEqual(expectedOutput, outputFiltered); % make sure they match
end
Actually, if you want to try writing a unit test, this function is perfect for it.
dummyData
folder inside thetests
directory.tests
folder (see below for a template)_Originally posted by @Remi-Gau in https://github.com/cpp-lln-lab/CPP_PTB/pull/75#issuecomment-678102618_