From 6c66dece53a71a0a484289e15304bebe65d8f76f Mon Sep 17 00:00:00 2001 From: Joe Corall Date: Thu, 9 Nov 2023 14:18:09 -0500 Subject: [PATCH] Add test coverage for IncludeFile --- fixtures/config.txt | 2 ++ fixtures/scholar.txt | 3 +++ scripts/test.sh | 12 ++++++------ 3 files changed, 11 insertions(+), 6 deletions(-) create mode 100644 fixtures/scholar.txt diff --git a/fixtures/config.txt b/fixtures/config.txt index d155def..042c97a 100644 --- a/fixtures/config.txt +++ b/fixtures/config.txt @@ -1,3 +1,5 @@ U lts.lehigh.edu H preserve.lehigh.edu D lib.lehigh.edu + +IncludeFile scholar.txt diff --git a/fixtures/scholar.txt b/fixtures/scholar.txt new file mode 100644 index 0000000..1b7ba7a --- /dev/null +++ b/fixtures/scholar.txt @@ -0,0 +1,3 @@ +Title Google Scholar +URL https://scholar.google.com +Host https://scholar.google.com diff --git a/scripts/test.sh b/scripts/test.sh index c848d25..a9be289 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -13,15 +13,15 @@ URLS=( "https://preserve.lehigh.edu" "https://$RANDOM.lib.lehigh.edu" "https://$RANDOM.$RANDOM.lib.lehigh.edu" - + "https://scholar.google.com" ) for URL in "${URLS[@]}"; do - echo "Checking ${URL}" + echo -e "\tChecking ${URL}" STATUS_CODE=$(curl -w '%{http_code}' \ -o /dev/null \ -s \ "http://localhost:8888/proxyUrl?url=$URL") - echo -e "\t${STATUS_CODE}" + echo -e "\t\t${STATUS_CODE}" if [ ! "${STATUS_CODE}" -eq 200 ]; then EXIT_CODE=1 fi @@ -29,17 +29,17 @@ done echo "Checking domains not in config throw 404s" URLS=( - "https://scholar.google.com" + "https://lts.lehigh.COM" "https://$RANDOM.lehigh.edu" "https://$RANDOM.$RANDOM.lehigh.edu" ) for URL in "${URLS[@]}"; do - echo "Checking ${URL}" + echo -e "\tChecking ${URL}" STATUS_CODE=$(curl -w '%{http_code}' \ -o /dev/null \ -s \ "http://localhost:8888/proxyUrl?url=$URL") - echo -e "\t${STATUS_CODE}" + echo -e "\t\t${STATUS_CODE}" if [ ! "${STATUS_CODE}" -eq 404 ]; then EXIT_CODE=1 fi