summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2012-07-18 11:43:39 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2012-07-18 11:43:39 +0200
commit919af48c9db5bd53149cb9d9e23378282d1ac9ce (patch)
tree2f4f0ee5680fa3b64d4b6d2cf893894a30f746ea /test
parent0859091a11d28dfae483bdbf9b85da83a5e21806 (diff)
downloadcollection-json-explorer-919af48c9db5bd53149cb9d9e23378282d1ac9ce.tar.gz
collection-json-explorer-919af48c9db5bd53149cb9d9e23378282d1ac9ce.tar.bz2
collection-json-explorer-919af48c9db5bd53149cb9d9e23378282d1ac9ce.tar.xz
collection-json-explorer-919af48c9db5bd53149cb9d9e23378282d1ac9ce.zip
o Trying to get the last slash correct in the URLs.
Diffstat (limited to 'test')
-rw-r--r--test/split.js19
1 files changed, 15 insertions, 4 deletions
diff --git a/test/split.js b/test/split.js
index 4bf8277..ece6b5f 100644
--- a/test/split.js
+++ b/test/split.js
@@ -4,15 +4,26 @@ var assert = require('assert')
function assertSplit(url, expected) {
var actual = routes.split(url);
- // console.log('actual ', util.inspect(actual));
// console.log('expected', util.inspect(expected));
- assert.deepEqual(actual, expected);
+ // console.log('actual ', util.inspect(actual));
+ assert.equal(util.inspect(expected), util.inspect(actual));
}
describe('routes.split', function() {
+ it('http://localhost:123', function() {
+ assertSplit('http://localhost:123', [
+ ['http://localhost:123','http://localhost:123']
+ ]);
+ });
it('http://localhost:123/', function() {
assertSplit('http://localhost:123/', [
- ['http://localhost:123','http://localhost:123']
+ ['http://localhost:123/','http://localhost:123/']
+ ]);
+ });
+ it('http://localhost:123/?a=b', function() {
+ assertSplit('http://localhost:123/?a=b', [
+ ['http://localhost:123','http://localhost:123'],
+ ['/?a=b','http://localhost:123/?a=b']
]);
});
it('http://localhost:123/foo', function() {
@@ -24,7 +35,7 @@ describe('routes.split', function() {
it('http://localhost:123/foo/', function() {
assertSplit('http://localhost:123/foo/', [
['http://localhost:123','http://localhost:123'],
- ['/foo','http://localhost:123/foo'],
+ ['/foo/','http://localhost:123/foo/'],
]);
});
it('http://localhost:123/a?x=1&y=2', function() {