From 308d771dd1973015166f0ac3b6cc7d538f7911c4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=B6rn=20Zaefferer?= Date: Sat, 30 Sep 2006 14:34:49 +0000 Subject: [PATCH] Refactored and fixed test suite to run async tests --- build/test/data/json.php | 8 ++++++++ build/test/data/name.php | 22 ++++++++++++++++++++++ build/test/data/test.js | 1 + build/test/data/testrunner.js | 2 +- build/test/index.html | 8 +++++--- build/test/test.js | 7 ++++++- 6 files changed, 43 insertions(+), 5 deletions(-) create mode 100644 build/test/data/json.php create mode 100644 build/test/data/name.php create mode 100644 build/test/data/test.js diff --git a/build/test/data/json.php b/build/test/data/json.php new file mode 100644 index 000000000..31668cf29 --- /dev/null +++ b/build/test/data/json.php @@ -0,0 +1,8 @@ + \ No newline at end of file diff --git a/build/test/data/name.php b/build/test/data/name.php new file mode 100644 index 000000000..a287fc92f --- /dev/null +++ b/build/test/data/name.php @@ -0,0 +1,22 @@ +$xml$result"; + die(); +} +$name = $_REQUEST['name']; +if($name == 'foo') { + echo "bar"; + die(); +} else if($name == 'peter') { + echo "pan"; + die(); +} +echo "ERROR"; +?> \ No newline at end of file diff --git a/build/test/data/test.js b/build/test/data/test.js new file mode 100644 index 000000000..2764fe107 --- /dev/null +++ b/build/test/data/test.js @@ -0,0 +1 @@ +foobar = "bar"; diff --git a/build/test/data/testrunner.js b/build/test/data/testrunner.js index db97215be..11921f9c7 100644 --- a/build/test/data/testrunner.js +++ b/build/test/data/testrunner.js @@ -50,8 +50,8 @@ function runTest(tests) { } function test(name, callback) { - Test = []; synchronize(function() { + Test = []; try { callback(); } catch(e) { diff --git a/build/test/index.html b/build/test/index.html index 2124948a6..048eec17c 100644 --- a/build/test/index.html +++ b/build/test/index.html @@ -34,9 +34,9 @@

Try them out:

    -
    - - + + + @@ -48,6 +48,8 @@ + +