Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function compareCanonizedExpectedNQuads(test, result) {
let expect;
try {
expect = await readTestNQuads(_getExpectProperty(test))(test);
const opts = {algorithm: 'URDNA2015'};
const expectDataset = rdfCanonize.NQuads.parse(expect);
const expectCmp = await rdfCanonize.canonize(expectDataset, opts);
const resultDataset = rdfCanonize.NQuads.parse(result);
const resultCmp = await rdfCanonize.canonize(resultDataset, opts);
assert.strictEqual(resultCmp, expectCmp);
} catch(err) {
if(options.bailOnError) {
console.log('\nTEST FAILED\n');
console.log('EXPECTED:\n' + expect);
console.log('ACTUAL:\n' + result);
}
throw err;
}
}