I need to allow only vectors like function([a, b, c, d])
or function(a, b, c, d)
to my program. I need to write a unit test that gives a syntax error when I get parameters of the form function([a, b][c, d])
and function([a][b][c][d])
.
Note that I am not looking for just an array here. I need to filter out multiple arrays and only take in single dimensional array (or no arrays at all)
How can I check the existence of such parameters?