Test to demonstrate regression introduced in r10130 (see #1704).
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10131 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -892,7 +892,7 @@
|
||||
}
|
||||
|
||||
function test_Util_getParameters(t) {
|
||||
t.plan(8);
|
||||
t.plan(9);
|
||||
|
||||
t.eq(OpenLayers.Util.getParameters('http://www.example.com'), {},
|
||||
"getParameters works when args = ''");
|
||||
@@ -916,6 +916,12 @@
|
||||
t.eq(OpenLayers.Util.getParameters('http://www.example.com?foo=bar%3Aone%2Cpub%2Cdisco'),
|
||||
{'foo': ['bar:one', 'pub', 'disco']},
|
||||
"getParameters works with a URL encoded comma-separated values (parses into array)");
|
||||
|
||||
var value = "%20"; // say you wanted to have a query string parameter value be literal "%20"
|
||||
var encoded = encodeURIComponent(value); // this is the proper URI component encoding
|
||||
var url = "http://example.com/path?key=" + encoded; // this is a properly encoded URL
|
||||
var params = OpenLayers.Util.getParameters(url);
|
||||
t.eq(params.key, value, "a properly encoded value of '%20' is properly decoded");
|
||||
}
|
||||
|
||||
function test_Util_getArgs(t) {
|
||||
|
||||
Reference in New Issue
Block a user