From 776d00c6cd7cabc16f13a18eee54fa2f3f36bf21 Mon Sep 17 00:00:00 2001 From: Peter Bex Date: Sun, 29 Jul 2018 19:39:39 +0200 Subject: Port to CHICKEN 5 --- tests/testweb/data | 1 + tests/testweb/denied.txt | 1 + tests/testweb/hello.txt | 1 + tests/testweb/index.html | 15 +++++++++++++++ tests/testweb/once.scm | 2 ++ tests/testweb/pics/chicken-logo.png | Bin 0 -> 24679 bytes tests/testweb/pics/lambda-chicken.gif | Bin 0 -> 1050 bytes tests/testweb/secrets/bank/pin-code.txt | 1 + tests/testweb/secrets/password.txt | 1 + tests/testweb/secrets/spiffy-access | 5 +++++ tests/testweb/spiffy-access | 4 ++++ tests/testweb/subdir with space/index.html | 14 ++++++++++++++ tests/testweb/subdir/index.html | 15 +++++++++++++++ tests/testweb/subdir/spiffy-access | 4 ++++ tests/testweb/subdir/subsubdir/index.html | 15 +++++++++++++++ tests/testweb/test.myscript | 1 + 16 files changed, 80 insertions(+) create mode 100644 tests/testweb/data create mode 100644 tests/testweb/denied.txt create mode 100644 tests/testweb/hello.txt create mode 100644 tests/testweb/index.html create mode 100644 tests/testweb/once.scm create mode 100644 tests/testweb/pics/chicken-logo.png create mode 100644 tests/testweb/pics/lambda-chicken.gif create mode 100644 tests/testweb/secrets/bank/pin-code.txt create mode 100644 tests/testweb/secrets/password.txt create mode 100644 tests/testweb/secrets/spiffy-access create mode 100644 tests/testweb/spiffy-access create mode 100644 tests/testweb/subdir with space/index.html create mode 100644 tests/testweb/subdir/index.html create mode 100644 tests/testweb/subdir/spiffy-access create mode 100644 tests/testweb/subdir/subsubdir/index.html create mode 100644 tests/testweb/test.myscript (limited to 'tests/testweb') diff --git a/tests/testweb/data b/tests/testweb/data new file mode 100644 index 0000000..1331fda --- /dev/null +++ b/tests/testweb/data @@ -0,0 +1 @@ +This is some data. Who knows what content type it could be? \ No newline at end of file diff --git a/tests/testweb/denied.txt b/tests/testweb/denied.txt new file mode 100644 index 0000000..94e2755 --- /dev/null +++ b/tests/testweb/denied.txt @@ -0,0 +1 @@ +This file should not be accessible (tests ensure that) diff --git a/tests/testweb/hello.txt b/tests/testweb/hello.txt new file mode 100644 index 0000000..270c611 --- /dev/null +++ b/tests/testweb/hello.txt @@ -0,0 +1 @@ +hello, world! diff --git a/tests/testweb/index.html b/tests/testweb/index.html new file mode 100644 index 0000000..4ec1376 --- /dev/null +++ b/tests/testweb/index.html @@ -0,0 +1,15 @@ + + + + This is an index page + + +

An index page

+ +

Hard to believe, but yes, this is an index page. It does not really +provide you with an index of any kind, but it's here to let spiffy's +test know that we loaded the index page even when we simply provided a +directory name with no filename.

+ + \ No newline at end of file diff --git a/tests/testweb/once.scm b/tests/testweb/once.scm new file mode 100644 index 0000000..f725903 --- /dev/null +++ b/tests/testweb/once.scm @@ -0,0 +1,2 @@ +(let ((counter (with-input-from-file "counter" read))) + (with-output-to-file "counter" (lambda () (write (add1 counter))))) diff --git a/tests/testweb/pics/chicken-logo.png b/tests/testweb/pics/chicken-logo.png new file mode 100644 index 0000000..072b068 Binary files /dev/null and b/tests/testweb/pics/chicken-logo.png differ diff --git a/tests/testweb/pics/lambda-chicken.gif b/tests/testweb/pics/lambda-chicken.gif new file mode 100644 index 0000000..5c3ccc7 Binary files /dev/null and b/tests/testweb/pics/lambda-chicken.gif differ diff --git a/tests/testweb/secrets/bank/pin-code.txt b/tests/testweb/secrets/bank/pin-code.txt new file mode 100644 index 0000000..81c545e --- /dev/null +++ b/tests/testweb/secrets/bank/pin-code.txt @@ -0,0 +1 @@ +1234 diff --git a/tests/testweb/secrets/password.txt b/tests/testweb/secrets/password.txt new file mode 100644 index 0000000..a1ddf5c --- /dev/null +++ b/tests/testweb/secrets/password.txt @@ -0,0 +1 @@ +Follow the yellow brick road \ No newline at end of file diff --git a/tests/testweb/secrets/spiffy-access b/tests/testweb/secrets/spiffy-access new file mode 100644 index 0000000..bd6e4e8 --- /dev/null +++ b/tests/testweb/secrets/spiffy-access @@ -0,0 +1,5 @@ +(lambda (continue) + (with-headers `((content-length ,(string-length noway))) + (lambda () + (write-logged-response) + (display noway (response-port (current-response)))))) \ No newline at end of file diff --git a/tests/testweb/spiffy-access b/tests/testweb/spiffy-access new file mode 100644 index 0000000..a4ffff5 --- /dev/null +++ b/tests/testweb/spiffy-access @@ -0,0 +1,4 @@ +(lambda (continue) + (let ((counter (with-input-from-file "root-counter" read))) + (with-output-to-file "root-counter" (lambda () (write (add1 counter))))) + (continue)) diff --git a/tests/testweb/subdir with space/index.html b/tests/testweb/subdir with space/index.html new file mode 100644 index 0000000..0d97655 --- /dev/null +++ b/tests/testweb/subdir with space/index.html @@ -0,0 +1,14 @@ + + + + This is an index page in a subdir with a space + + +

An index page

+ +

This is here to test whether Spiffy can handle redirects to URLs +with spaces (and more generally, encoding of special URI chars) +correctly.

+ + diff --git a/tests/testweb/subdir/index.html b/tests/testweb/subdir/index.html new file mode 100644 index 0000000..8fecc46 --- /dev/null +++ b/tests/testweb/subdir/index.html @@ -0,0 +1,15 @@ + + + + This is an index page in a subdir + + +

An index page

+ +

Hard to believe, but yes, this is an index page in a subdir. +It does not really provide you with an index of any kind, but it's +here to let spiffy's test know that we loaded the index page even +when we simply provided a directory name with no filename.

+ + diff --git a/tests/testweb/subdir/spiffy-access b/tests/testweb/subdir/spiffy-access new file mode 100644 index 0000000..265eb7b --- /dev/null +++ b/tests/testweb/subdir/spiffy-access @@ -0,0 +1,4 @@ +(lambda (continue) + (let ((counter (with-input-from-file "counter" read))) + (with-output-to-file "counter" (lambda () (write (add1 counter))))) + (continue)) diff --git a/tests/testweb/subdir/subsubdir/index.html b/tests/testweb/subdir/subsubdir/index.html new file mode 100644 index 0000000..de9d3c3 --- /dev/null +++ b/tests/testweb/subdir/subsubdir/index.html @@ -0,0 +1,15 @@ + + + + This is an index page in a subdir under a subdir + + +

An index page

+ +

Hard to believe, but yes, this is an index page in a subsubdir. +It does not really provide you with an index of any kind, but it's +here to let spiffy's test know that we loaded the index page even +when we simply provided a directory name with no filename.

+ + diff --git a/tests/testweb/test.myscript b/tests/testweb/test.myscript new file mode 100644 index 0000000..4b3bed3 --- /dev/null +++ b/tests/testweb/test.myscript @@ -0,0 +1 @@ +Contents of this file are irrelevant \ No newline at end of file -- cgit v1.2.3