Ensure test responses are displayed in their unprocessed form.
[davical.git] / testing / normalise_result
blobafea7fcc84660c5dbc5870a02639149bc79c0c51
1 #!/usr/bin/perl -w
3 # Given a result on stdin, try and normalise some
4 # elements of it (such as HTTP Header dates) so that we can
5 # simply compare it with other results
8 use strict;
10 while( <STDIN> ) {
12 /^Server: Apache(\/[0-9.]+)?/ && do {
13 $_ = "";
16 /^X-Powered-By: PHP\/[0-9.]+/ && do {
17 $_ = "";
20 /^X-Pad: avoid browser bug/ && do {
21 $_ = "";
24 /^Keep-Alive:/ && do {
25 $_ = "";
28 /^Connection:/ && do {
29 $_ = "";
32 /^Transfer-Encoding:/ && do {
33 $_ = "";
36 /^Vary: / && do {
37 $_ = "";
40 /^X-(DAViCal|RSCDS)-Version: (DAViCal|RSCDS)\/[0-9.]+\.[0-9.]+\.[0-9.]+; DB\/[0-9.]+\.[0-9.]+\.[0-9.]+/ && do {
41 $_ = "";
44 # HTTP Standard Dates
45 s/(Mon|Tue|Wed|Thu|Fri|Sat|Sun), [0-3][0-9] (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) 2[0-9]{3} [0-2][0-9](:[0-5][0-9]){2} GMT/Dow, 01 Jan 2000 00:00:00 GMT/;
47 # Fix up any opaquelocktokens to something regular
48 s/opaquelocktoken:[[:xdigit:]]{8}-([[:xdigit:]]{4}-){3}[[:xdigit:]]{12}/opaquelocktoken:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/;
50 print;