Cheating a bit. I believe test suite need some "try...catch" to prevent such behaviour.
nevertheless, didn't see this coming. never expected that kinda structure would work.
@Jan Orwat, Nice! Everything is changes from star to star.
Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
fid = fopen('anonymous.m');
st = regexprep(char(fread(fid)'), 'function', 'error(''No fancy functions!''); %','ignorecase',2);
fclose(fid);
fid = fopen('anonymous.m' , 'w');
fwrite(fid,st);
fclose(fid);
|
2 | Pass |
f = anonymous;
a = f(1);
assert(a==1);
|
3 | Pass |
f = anonymous;
a = f(1,2);
assert(a==1);
[a,b] = f(3,5);
assert(a==3&b==5);
|
4 | Pass |
f = anonymous;
a = f(1,2);
assert(a==1);
[a,b] = f(3,'56');
assert(a==3&isequal(b,'56'));
|
Make the vector [1 2 3 4 5 6 7 8 9 10]
29450 Solvers
8415 Solvers
96 Solvers
214 Solvers
309 Solvers