aboutsummaryrefslogtreecommitdiffstats
path: root/test_harnesses
diff options
context:
space:
mode:
authorJez Ng2012-01-15 17:39:58 +0800
committerJez Ng2012-01-15 18:01:37 +0800
commitfbdff8626a8db7be33a6b7790a35e48c4c5231aa (patch)
tree9aa312a6869b455cbc54789f07a2c305a128499c /test_harnesses
parent3ff0518014a51f237d1d98ebc15c0ce4be24c2b5 (diff)
downloadvimium-fbdff8626a8db7be33a6b7790a35e48c4c5231aa.tar.bz2
Handle pasted URLs intelligently.
Diffstat (limited to 'test_harnesses')
-rw-r--r--test_harnesses/automated.html13
1 files changed, 13 insertions, 0 deletions
diff --git a/test_harnesses/automated.html b/test_harnesses/automated.html
index 5e3ae93c..764b0d2f 100644
--- a/test_harnesses/automated.html
+++ b/test_harnesses/automated.html
@@ -250,6 +250,19 @@
);
+ context("Web query parsing",
+
+ should("Convert query string to valid URL", function() {
+ assert.equal("http://www.google.com/", utils.ensureUrl("http://www.google.com/"));
+ assert.equal("http://www.google.com/", utils.ensureUrl(" http://www.google.com/ "));
+ assert.equal("http://www.google.com", utils.ensureUrl("www.google.com"));
+ assert.equal("http://google.com", utils.ensureUrl("google.com"));
+ assert.equal("http://www.google.com/search?q=google", utils.ensureUrl("google"));
+ assert.equal("http://www.google.com/search?q=go ogle.com", utils.ensureUrl("go ogle.com"));
+ })
+
+ );
+
Tests.outputMethod = function(output) {
var newOutput = Array.prototype.join.call(arguments, "\n");
newOutput = newOutput.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"); // escape html