%function OK = csv2struct_test()
%csv2struct_test tets for csv2struct
%
%See also: csv2struct
clear all
clc
D0.a  = [1 2 nan 3]'; %{'1','2','','3'}';
D0.aT = [1 2 nan 3]'; {'1','2','','3'}';
D0.b  = {'a','b','','c'}';
D0.bT = {'a','b','','c'}';

D1    = D0;
D1.b  = {'"a"','"b"','','"c"'}';
D1.bT = {'"a"','"b"','','"c"'}';

n=0;
for i=0:1
for j=0:1
for k=0:1
    
    n = n+1;
    
    si =num2str(i);pi = i+1;
    sj =num2str(j);pj = j+1;
    sk =num2str(k);pk = k+1;
    
    f{pi,pj,pk}  = [fileparts(mfilename('fullpath')),filesep,'comma_units',si,sj,sk,'.csv'];
    disp([filename(f{pi,pj,pk}),':'])
    D(pi,pj,pk)  = csv2struct(f{pi,pj,pk},'units',i,'quotes',[j k]);
    OK(pi,pj,pk) = isequalwithequalnans(D(pi,pj,pk),D0);
    disp([i,j,k,n,OK(pi,pj,pk)])
    
end
end
end

% test automatic removal of "" on col names

% test non-removal of "" 

OK = all(OK(:));