diff --git a/functions/check_dead.sh b/functions/check_dead.sh index 209d74e2b..c7795bc9a 100644 --- a/functions/check_dead.sh +++ b/functions/check_dead.sh @@ -143,7 +143,6 @@ check_alive() { # $1: file to process # Output: # dead.tmp -# exit status 0 (if dead domains found) # exit status 1 (if dead domains not found) find_dead() { sed 's/^/||/; s/$/^/' "$1" > formatted_domains.tmp diff --git a/functions/check_parked.sh b/functions/check_parked.sh index 45ada87f8..eb67b3e55 100644 --- a/functions/check_parked.sh +++ b/functions/check_parked.sh @@ -64,7 +64,6 @@ add_unparked_domains() { # $1: file to process # Output: # parked_domains.tmp -# exit status 0 (if parked domains found) # exit status 1 (if parked domains not found) retrieve_parked() { # Truncate temporary files between runs diff --git a/functions/test_functions.sh b/functions/test_functions.sh index 926638a49..392eb08c1 100644 --- a/functions/test_functions.sh +++ b/functions/test_functions.sh @@ -127,6 +127,9 @@ TEST_RETRIEVE_VALIDATE() { mv xab data/pending/domains_google_search_search-term-1.tmp mv xac data/pending/domains_google_search_search-term-2.tmp + # Prepare sample raw light file + cp "$RAW" "$RAW_LIGHT" + # Run retrieval script run_script retrieve_domains.sh fi @@ -135,7 +138,7 @@ TEST_RETRIEVE_VALIDATE() { if [[ "$script_to_test" == 'validate' ]]; then # Use input.txt as sample raw files to test cp input.txt "$RAW" - cp input.txt "$RAW_LIGHT" + cp "$RAW" "$RAW_LIGHT" # Expected output for light version cp out_raw.txt out_raw_light.txt @@ -487,7 +490,6 @@ test_source_log() { # TEST: exclusion of specific sources from light version test_light_build() { - cp "$RAW" "$RAW_LIGHT" # INPUT printf "raw-light-test.com\n" >> data/pending/domains_guntab.com.tmp # EXPECTED OUTPUT @@ -600,9 +602,7 @@ run_script() { printf "%s\n" "----------------------------------------------------------------------" # Return 1 if script has an exit status of 1 - if [[ "$errored" == true ]]; then - return 1 - fi + [[ "$errored" == true ]] && return 1 || return 0 } # Function 'check_and_exit' is a shell wrapper that checks if the script