Initial update to port over changes from jsonld.js.

This commit is contained in:
Dave Longley 2013-02-07 17:19:19 -05:00
parent 3309e2bd2b
commit 89dd522d45
2 changed files with 2204 additions and 1239 deletions

View file

@ -4,7 +4,7 @@
*
* @author Dave Longley
*
* Copyright (c) 2011-2012 Digital Bazaar, Inc. All rights reserved.
* Copyright (c) 2011-2013 Digital Bazaar, Inc. All rights reserved.
*/
require_once('jsonld.php');
@ -261,7 +261,12 @@ class TestRunner {
'base' => 'http://json-ld.org/test-suite/tests/' . $test->input);
try {
if(in_array('jld:NormalizeTest', $type)) {
if(in_array('jld:ApiErrorTest', $type)) {
echo "Skipping test \"{$test->name}\" of type: " .
json_encode($type) . $eol;
continue;
}
else if(in_array('jld:NormalizeTest', $type)) {
$this->test($test->name);
$input = read_test_json($test->input, $filepath);
$test->expect = read_test_nquads($test->expect, $filepath);
@ -281,6 +286,12 @@ class TestRunner {
$test->expect = read_test_json($test->expect, $filepath);
$result = jsonld_compact($input, $test->context, $options);
}
else if(in_array('jld:FlattenTest', $type)) {
$this->test($test->name);
$input = read_test_json($test->input, $filepath);
$test->expect = read_test_json($test->expect, $filepath);
$result = jsonld_flatten($input, null, $options);
}
else if(in_array('jld:FrameTest', $type)) {
$this->test($test->name);
$input = read_test_json($test->input, $filepath);

3428
jsonld.php

File diff suppressed because it is too large Load diff