summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/modules/scheme/eval-test.cpp
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2011-04-17 22:14:18 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2011-04-17 22:14:18 +0000
commita0f68830211cbea1112794922939f8c5e90d7c4e (patch)
tree79b0ac2bf128a18e80bb08c19f3d08efe6fc5ec6 /sca-cpp/trunk/modules/scheme/eval-test.cpp
parentff2490e3b4638b421c381946d8b1ebb30e51141b (diff)
Fix representation of null values and escape control characters in JSON and HTTP query strings.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1094210 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-cpp/trunk/modules/scheme/eval-test.cpp')
-rw-r--r--sca-cpp/trunk/modules/scheme/eval-test.cpp38
1 files changed, 24 insertions, 14 deletions
diff --git a/sca-cpp/trunk/modules/scheme/eval-test.cpp b/sca-cpp/trunk/modules/scheme/eval-test.cpp
index 7c4c0c69c4..dd97bc358d 100644
--- a/sca-cpp/trunk/modules/scheme/eval-test.cpp
+++ b/sca-cpp/trunk/modules/scheme/eval-test.cpp
@@ -72,20 +72,30 @@ bool testRead() {
}
bool testWrite() {
- const list<value> i = list<value>()
- + (list<value>() + "item" + "cart-53d67a61-aa5e-4e5e-8401-39edeba8b83b"
- + (list<value>() + "item"
- + (list<value>() + "name" + "Apple")
- + (list<value>() + "price" + "$2.99")))
- + (list<value>() + "item" + "cart-53d67a61-aa5e-4e5e-8401-39edeba8b83c"
- + (list<value>() + "item"
- + (list<value>() + "name" + "Orange")
- + (list<value>() + "price" + "$3.55")));
- const list<value> a = cons<value>("Feed", cons<value>("feed-1234", i));
- ostringstream os;
- writeValue(a, os);
- istringstream is(str(os));
- assert(readValue(is) == a);
+ {
+ const list<value> i = list<value>()
+ + (list<value>() + "item" + "cart-53d67a61-aa5e-4e5e-8401-39edeba8b83b"
+ + (list<value>() + "item"
+ + (list<value>() + "name" + "Apple")
+ + (list<value>() + "price" + "$2.99")))
+ + (list<value>() + "item" + "cart-53d67a61-aa5e-4e5e-8401-39edeba8b83c"
+ + (list<value>() + "item"
+ + (list<value>() + "name" + "Orange")
+ + (list<value>() + "price" + "$3.55")));
+ const list<value> a = cons<value>("Feed", cons<value>("feed-1234", i));
+ ostringstream os;
+ writeValue(a, os);
+ istringstream is(str(os));
+ assert(readValue(is) == a);
+ }
+ {
+ const list<value> i = mklist<value>("x", value());
+ const list<value> a = mklist<value>(i);
+ ostringstream os;
+ writeValue(a, os);
+ istringstream is(str(os));
+ assert(readValue(is) == a);
+ }
return true;
}