--- a/inst/decode.m
+++ b/inst/decode.m
@@ -284,3 +284,12 @@
   endif
 
 endfunction
+
+%% Test input validation
+%!error decode ()
+%!error decode (1)
+%!error decode (1, 2)
+%!error decode (1, 2, 3, 4, 5, 6, 7)
+%!error decode (1, 2, 3)
+%!error decode (1, 5, 6)
+%!error decode (1, 5, 3, "invalid")