Use RDF statements in normalization.

Remove special compaction of null-mapped IRIs.
This commit is contained in:
Dave Longley 2012-05-05 16:03:30 -04:00
commit 52fa975894
2 changed files with 131 additions and 383 deletions

View file

@ -52,7 +52,7 @@ function deep_compare($expect, $result) {
return false;
}
foreach($expect as $k => $v) {
if(!deep_compare($v, $result->{$k})) {
if(!property_exists($result, $k) || !deep_compare($v, $result->{$k})) {
return false;
}
}
@ -152,14 +152,7 @@ class TestRunner {
public function check($test, $expect, $result) {
global $eol;
if(in_array('jld:NormalizeTest', $test->{'@type'}) !== false) {
$pass = JsonLdProcessor::compareNormalized($expect, $result);
}
else {
$pass = deep_compare($expect, $result);
}
if($pass) {
if(deep_compare($expect, $result)) {
$this->passed += 1;
echo "PASS$eol";
}
@ -253,7 +246,8 @@ class TestRunner {
if(in_array('jld:NormalizeTest', $type)) {
$this->test($test->name);
$input = read_test_json($test->input, $filepath);
$test->expect = read_test_json($test->expect, $filepath);
$test->expect = read_test_nquads($test->expect, $filepath);
$options['format'] = 'application/nquads';
$result = jsonld_normalize($input, $options);
}
else if(in_array('jld:ExpandTest', $type)) {