pre-commit-src/tests/pre-commit-tests.sh
changeset 25711 2bb339143f01
parent 25710 b3dddcc5f208
equal deleted inserted replaced
25710:b3dddcc5f208 25711:2bb339143f01
     9     exit $exit_code
     9     exit $exit_code
    10 }
    10 }
    11 trap 'error_handler $LINENO' ERR
    11 trap 'error_handler $LINENO' ERR
    12 
    12 
    13 # Load the pre-commit script
    13 # Load the pre-commit script
    14 source ./pre-commit-src/pre-commit --load-only
    14 . ./pre-commit-src/pre-commit-script.sh --load-only
    15 
    15 
    16 score=0
    16 score=0
    17 total=0
    17 total=0
    18 
    18 
    19 mode="${1:-}"
    19 mode="${1:-}"
   498 test_extract_domains_variables_in_included_filterlists
   498 test_extract_domains_variables_in_included_filterlists
   499 test_extract_domains_variables_in_included_json_files
   499 test_extract_domains_variables_in_included_json_files
   500 test_check_domain_variables_in_filterlists
   500 test_check_domain_variables_in_filterlists
   501 test_check_if_domains_variables_are_identical_in_lists_and_jsons
   501 test_check_if_domains_variables_are_identical_in_lists_and_jsons
   502 
   502 
       
   503 # Remove aliases created in pre-commit-script.sh
       
   504 unalias jq
       
   505 unalias grep
       
   506 unalias git
       
   507 
   503 echo -e '\n-------------------------------------------\n'
   508 echo -e '\n-------------------------------------------\n'
   504 if [ $score -eq $total ]; then
   509 if [ $score -eq $total ]; then
   505     if [ "$mode" != '--no-verbose' ]; then
   510     if [ "$mode" != '--no-verbose' ]; then
   506         echo 'All tests from pre-commit-tests.sh passed.'
   511         echo 'All tests from pre-commit-tests.sh passed.'
   507     fi
   512     fi