Comparing version 0.0.13 to 0.0.14
{ | ||
"name": "jsonld", | ||
"version": "0.0.13", | ||
"version": "0.0.14", | ||
"description": "A JSON-LD Processor and API implementation in JavaScript.", | ||
@@ -5,0 +5,0 @@ "homepage": "http://github.com/digitalbazaar/jsonld.js", |
@@ -6,3 +6,3 @@ /** | ||
* | ||
* Copyright (c) 2011-2012 Digital Bazaar, Inc. All rights reserved. | ||
* Copyright (c) 2011-2013 Digital Bazaar, Inc. All rights reserved. | ||
*/ | ||
@@ -14,3 +14,3 @@ var assert = require('assert'); | ||
var util = require('util'); | ||
var jsonld = require('../js/jsonld'); | ||
var jsonld = require('../js/jsonld')(); | ||
@@ -88,3 +88,3 @@ function TestRunner() { | ||
if(!(j in iso)) { | ||
if(this.expandedEqual(x[i], y[j])) { | ||
if(this.expandedEqual(x[i], y[j], false)) { | ||
iso[j] = i; | ||
@@ -100,5 +100,5 @@ rval = true; | ||
} | ||
else if(typeof x === 'object') { | ||
var xKeys = Object.keys(x).sort(); | ||
var yKeys = Object.keys(y).sort(); | ||
if(typeof x === 'object') { | ||
var xKeys = Object.keys(x); | ||
var yKeys = Object.keys(y); | ||
if(xKeys.length !== yKeys.length) { | ||
@@ -122,3 +122,3 @@ return false; | ||
TestRunner.prototype.check = function(test, expect, result, expanded) { | ||
TestRunner.prototype.check = function(test, expect, result, type) { | ||
var line = ''; | ||
@@ -132,3 +132,14 @@ var pass = false; | ||
catch(ex) { | ||
pass = expanded && this.expandedEqual(expect, result); | ||
var expanded = ( | ||
type.indexOf('jld:ExpandTest') !== -1 || | ||
type.indexOf('jld:FlattenTest') !== -1); | ||
var relabel = (type.indexOf('jld:FlattenTest') !== -1); | ||
if(expanded) { | ||
// relabel blank nodes | ||
if(relabel) { | ||
expect = jsonld.relabelBlankNodes(expect); | ||
result = jsonld.relabelBlankNodes(result); | ||
} | ||
pass = this.expandedEqual(expect, result); | ||
} | ||
} | ||
@@ -271,6 +282,3 @@ finally { | ||
} | ||
self.check( | ||
test, test.expect, result, | ||
type.indexOf('jld:ExpandTest') !== -1 || | ||
type.indexOf('jld:FlattenTest') !== -1); | ||
self.check(test, test.expect, result, type); | ||
callback(); | ||
@@ -277,0 +285,0 @@ }; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5958
1108183