summaryrefslogtreecommitdiff
path: root/misc/openlayers/tests/Format/JSON.html
diff options
context:
space:
mode:
authorChris Schlaeger <chris@linux.com>2015-10-17 21:36:38 +0200
committerChris Schlaeger <chris@linux.com>2015-10-17 21:36:38 +0200
commite30f267181d990947e67909de4809fa941698c85 (patch)
tree46e9f94c2b3699ed378963b420b8a8d361286ea1 /misc/openlayers/tests/Format/JSON.html
parente763ceb183f389fcd314a4a6a712d87c9d4cdb32 (diff)
downloadpostrunner-e30f267181d990947e67909de4809fa941698c85.zip
Upgrading openlayers to 3.x
Diffstat (limited to 'misc/openlayers/tests/Format/JSON.html')
-rw-r--r--misc/openlayers/tests/Format/JSON.html53
1 files changed, 0 insertions, 53 deletions
diff --git a/misc/openlayers/tests/Format/JSON.html b/misc/openlayers/tests/Format/JSON.html
deleted file mode 100644
index 84461e1..0000000
--- a/misc/openlayers/tests/Format/JSON.html
+++ /dev/null
@@ -1,53 +0,0 @@
-<html>
-<head>
- <script src="../OLLoader.js"></script>
- <script type="text/javascript">
-
- function test_Format_JSON_constructor(t) {
- t.plan(4);
-
- var options = {'foo': 'bar'};
- var format = new OpenLayers.Format.JSON(options);
- t.ok(format instanceof OpenLayers.Format.JSON,
- "new OpenLayers.Format.JSON returns object" );
- t.eq(format.foo, "bar", "constructor sets options correctly");
- t.eq(typeof format.read, "function", "format has a read function");
- t.eq(typeof format.write, "function", "format has a write function");
- }
-
- function test_Format_JSON_parser(t) {
- t.plan(2);
-
- var format = new OpenLayers.Format.JSON();
- var data = format.read('{"a":["b"], "c":1}');
- var obj = {"a":["b"], "c":1};
- t.eq(obj['a'], data['a'], "element with array parsed correctly.");
- t.eq(obj['c'], data['c'], "element with number parsed correctly.");
- }
-
- function test_Format_JSON_writer(t) {
- t.plan(1);
-
- var format = new OpenLayers.Format.JSON();
- var data = format.write({"a":["b"], "c":1});
- var obj = '{"a":["b"],"c":1}';
- t.eq(data, obj, "writing data to json works.");
- }
-
-
- function test_keepData(t) {
- t.plan(2);
-
- var options = {'keepData': true};
- var format = new OpenLayers.Format.JSON(options);
- format.read('{"a":["b"], "c":1}');
-
- t.ok(format.data != null, 'data property is not null after read with keepData=true');
- t.eq(format.data.c,1,'keepData keeps the right data');
- }
-
- </script>
-</head>
-<body>
-</body>
-</html>