#!/usr/bin/env bash # Note: This is not directly executable. # This is for VIM syntax highlighting. describe "* abrute with invalid input" it "too few arguments" target/debug/abrute 2>/dev/null assert unequal $? 0 end it "invalid range" target/debug/abrute a:b asdf -- test/data/example.file.aes 2>/dev/null assert unequal $? 0 end it "file does not exist" target/debug/abrute 4:4 asdf -- test/data/example-thingy.file.aes 2>/dev/null assert unequal $? 0 end it "does not panic with invalid range" message=`target/debug/abrute asdf asdf -- asdf 2>& 1` echo "$message" | grep -q "thread*" assert unequal $? 0 end it "does not panic with file missing" message=`target/debug/abrute 4 asdf -- asdf 2>& 1` echo "$message" | grep -q "thread*" assert unequal $? 0 end it "does not panic with invalid adjacent number" message=`target/debug/abrute 4 asdf -a g -- asdf 2>& 1` echo "$message" | grep -q "thread*" assert unequal $? 0 end it "does not panic with invalid character starters" message=`target/debug/abrute 4 asdf -s 1234 -- asdf 2>& 1` echo "$message" | grep -q "thread*" assert unequal $? 0 end it "does not panic with invalid characters length" message=`target/debug/abrute 4 asdf -s 12 -- asdf 2>& 1` echo "$message" | grep -q "thread*" assert unequal $? 0 end it "does not show invalid double dash on invalid dash usage" message=`target/debug/abrute 4 asdf asdf 2>& 1` echo "$message" | grep -q " -- " assert equal $? 0 end end describe "* abrute with failed results" # false positive: `unzip -uP dfsd example.zip` it "fails with unzip" folder="$(pwd)" cd test/data/ ../../target/debug/abrute 4 asdfg -z -a 0 -- example.zip > /dev/null 2>&1 assert unequal $? 0 cd $folder assert file_absent test/data/zipped.file end end