/[jscoverage]/trunk/tests/charset.sh
ViewVC logotype

Diff of /trunk/tests/charset.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 251 by siliconforks, Sun Oct 5 18:08:00 2008 UTC revision 314 by siliconforks, Mon Oct 13 17:52:41 2008 UTC
# Line 39  Line 39 
39    delay=2    delay=2
40  fi  fi
41    
42    if jscoverage-server --version | grep -q 'iconv\|MultiByteToWideChar'
43    then
44      character_encoding_support=yes
45    else
46      character_encoding_support=no
47    fi
48    
49  $VALGRIND jscoverage-server --proxy --no-highlight > OUT 2> ERR &  $VALGRIND jscoverage-server --proxy --no-highlight > OUT 2> ERR &
50  proxy_server_pid=$!  proxy_server_pid=$!
51  proxy_server_port=8080  proxy_server_port=8080
# Line 48  Line 55 
55    
56  sleep $delay  sleep $delay
57    
58  cat ../report.js > EXPECTED  case "$character_encoding_support" in
59  cat javascript-utf-8.expected/javascript-utf-8.js | sed 's/javascript-utf-8.js/http:\/\/127.0.0.1:8000\/utf-8.js/g' >> EXPECTED    yes)
60  curl -s -x 127.0.0.1:8080 http://127.0.0.1:8000/utf-8.js > ACTUAL      cat ../report.js > EXPECTED
61  diff EXPECTED ACTUAL      cat javascript-utf-8.expected/javascript-utf-8.js | sed 's/javascript-utf-8.js/http:\/\/127.0.0.1:8000\/utf-8.js/g' >> EXPECTED
62        curl -s -x 127.0.0.1:8080 http://127.0.0.1:8000/utf-8.js > ACTUAL
63        diff EXPECTED ACTUAL
64        ;;
65      *)
66        echo 500 > EXPECTED
67        ! curl -f -w '%{http_code}\n' -x 127.0.0.1:8080 http://127.0.0.1:8000/utf-8.js 2> /dev/null > ACTUAL
68        diff EXPECTED ACTUAL
69        ;;
70    esac
71    
72  shutdown  shutdown
73    
# Line 61  Line 77 
77    
78  sleep $delay  sleep $delay
79    
80  cat ../report.js > EXPECTED  case "$character_encoding_support" in
81  cat javascript.expected/javascript-iso-8859-1.js | sed 's/javascript-iso-8859-1.js/http:\/\/127.0.0.1:8000\/iso-8859-1.js/g' >> EXPECTED    yes)
82  curl -s -x 127.0.0.1:8080 http://127.0.0.1:8000/iso-8859-1.js > ACTUAL      cat ../report.js > EXPECTED
83        cat javascript.expected/javascript-iso-8859-1.js | sed 's/javascript-iso-8859-1.js/http:\/\/127.0.0.1:8000\/iso-8859-1.js/g' >> EXPECTED
84        curl -s -x 127.0.0.1:8080 http://127.0.0.1:8000/iso-8859-1.js > ACTUAL
85        diff EXPECTED ACTUAL
86        ;;
87      *)
88        echo 500 > EXPECTED
89        ! curl -f -w '%{http_code}\n' -x 127.0.0.1:8080 http://127.0.0.1:8000/iso-8859-1.js 2> /dev/null > ACTUAL
90        diff EXPECTED ACTUAL
91        ;;
92    esac
93    
94    # bogus charset
95    echo 500 > EXPECTED
96    ! curl -f -w '%{http_code}\n' -x 127.0.0.1:8080 http://127.0.0.1:8000/bogus.js 2> /dev/null > ACTUAL
97    diff EXPECTED ACTUAL
98    
99    # malformed encoding
100    case "$character_encoding_support" in
101      yes)
102        status=502
103        ;;
104      *)
105        status=500
106        ;;
107    esac
108    echo $status > EXPECTED
109    ! curl -f -w '%{http_code}\n' -x 127.0.0.1:8080 http://127.0.0.1:8000/malformed.js 2> /dev/null > ACTUAL
110  diff EXPECTED ACTUAL  diff EXPECTED ACTUAL

Legend:
Removed from v.251  
changed lines
  Added in v.314

  ViewVC Help
Powered by ViewVC 1.1.24