Various syntax/logic fixes.
This commit is contained in:
parent
cdce63a99c
commit
a1a5a4cb34
2 changed files with 47 additions and 52 deletions
|
@ -56,6 +56,7 @@ function deep_compare($expect, $result) {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
return $expect === $result;
|
||||
|
@ -130,7 +131,7 @@ class TestRunner {
|
|||
public function check($test, $expect, $result) {
|
||||
global $eol;
|
||||
|
||||
if(strpos($test->{'@type'}, 'NormalizeTest') !== false) {
|
||||
if(in_array('jld:NormalizeTest', $test->{'@type'}) !== false) {
|
||||
$pass = JsonLdProcessor::compareNormalized($expect, $result);
|
||||
}
|
||||
else {
|
||||
|
@ -154,9 +155,6 @@ class TestRunner {
|
|||
echo 'JSON Result: ' .
|
||||
json_encode(json_decode(result, $flags)) . $eol;
|
||||
*/
|
||||
|
||||
// FIXME: remove me
|
||||
throw new Exception('FAIL');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -173,12 +171,11 @@ class TestRunner {
|
|||
$handle = opendir($filepath);
|
||||
if($handle) {
|
||||
while(($file = readdir($handle)) !== false) {
|
||||
if($file !== '..' and $file !== '.')
|
||||
{
|
||||
$files[] = $filepath . '/' . $file;
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
if($file !== '..' and $file !== '.') {
|
||||
$files[] = $filepath . '/' . $file;
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
}
|
||||
else {
|
||||
throw new Exception('Could not open directory.');
|
||||
|
@ -243,6 +240,7 @@ class TestRunner {
|
|||
$result = jsonld_expand($input, $options);
|
||||
}
|
||||
else if(in_array('jld:CompactTest', $type)) {
|
||||
continue;
|
||||
$this->test($test->name);
|
||||
$input = read_test_json($test->input, $filepath);
|
||||
$test->context = read_test_json($test->context, $filepath);
|
||||
|
@ -250,6 +248,7 @@ class TestRunner {
|
|||
$result = jsonld_compact($input, $test->context, $options);
|
||||
}
|
||||
else if(in_array('jld:FrameTest', $type)) {
|
||||
continue;
|
||||
$this->test($test->name);
|
||||
$input = read_test_json($test->input, $filepath);
|
||||
$test->frame = read_test_json($test->frame, $filepath);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue