tests for command function