Skip to content

Commit

Permalink
filled out with other fields for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
neonspectra committed Nov 9, 2023
1 parent 3d5d77f commit 32e0efe
Showing 1 changed file with 36 additions and 1 deletion.
37 changes: 36 additions & 1 deletion ci/xml-reserved-characters.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ else
exit 1
fi
echo ""

echo "Testing to ensure that the title is rendering as it should..."
titletest="<title>Test Suite - XML Reserved Characters &#38; &#60; &#62; &#39; &#34;"
titletest="<title>CI Test Suite - XML Reserved Characters &#38; &#60; &#62; &#39; &#34;"
if [[ $(grep "$titletest" $testpage) ]]
then
echo "SUCCESS!"
Expand All @@ -32,3 +33,37 @@ else
echo "$(grep '<title>' $testpage | head -1)"
exit 1
fi
echo ""

echo "Testing to ensure that the author is rendering as they should..."
authortest='<meta name="author" content="Spectra Secure &#38; &#60; &#62; &#39; &#34;">'
if [[ $(grep "$authortest" $testpage) ]]
then
echo "SUCCESS!"
else
echo "FAILED. The page author line we were looking for did not render properly."
echo ""
echo "Pattern we were trying to match:"
echo "$authortest"
echo "==========="
echo "Full line that contains a discrepancy:"
echo "$(grep '<meta name="author"' $testpage | head -1)"
exit 1
fi
echo ""

echo "Testing to ensure that the description is rendering as it should..."
descriptiontest='<meta name="description" content="This post tests if we are properly filtering XML reserved characters in page metadata &#38; &#60; &#62; &#39; &#34;">'
if [[ $(grep "$descriptiontest" $testpage) ]]
then
echo "SUCCESS!"
else
echo "FAILED. The page description line we were looking for did not render properly."
echo ""
echo "Pattern we were trying to match:"
echo "$descriptiontest"
echo "==========="
echo "Full line that contains a discrepancy:"
echo "$(grep '<meta name="description"' $testpage | head -1)"
exit 1
fi

0 comments on commit 32e0efe

Please sign in to comment.