Add test for fancyindex_exact_size off

pull/62/head
Anders Trier Olesen 2016-11-02 11:47:27 +00:00 committed by Adrian Perez
parent 1e438a694d
commit 6442f26527
2 changed files with 13 additions and 0 deletions

9
t/03-exact_size_off.test Normal file
View File

@ -0,0 +1,9 @@
#! /bin/bash
cat <<---
We test if the output from using "fancyindex_exact_size off" looks sane
--
EXACT_SIZE="off"
nginx_start
content=$(fetch)
grep -e '[1-9]\.[0-9] KiB' <<< "${content}"
grep -E '[0-9]+ B' <<< "${content}"

View File

@ -6,6 +6,9 @@
# Distributed under terms of the MIT license. # Distributed under terms of the MIT license.
# #
# Configuration defaults
EXACT_SIZE="on"
function nginx_conf_generate () { function nginx_conf_generate () {
if ${DYNAMIC} ; then if ${DYNAMIC} ; then
echo 'load_module modules/ngx_http_fancyindex_module.so;' echo 'load_module modules/ngx_http_fancyindex_module.so;'
@ -27,6 +30,7 @@ function nginx_conf_generate () {
location / { location / {
index index.html; index index.html;
fancyindex on; fancyindex on;
fancyindex_exact_size ${EXACT_SIZE};
$* $*
} }
} }