@@ -25,15 +25,24 @@ public void ConformanceTestPasses(string id, string testname, ConformanceCase co
2525 }
2626 else
2727 {
28- Console . WriteLine ( id ) ;
29- Console . WriteLine ( "Actual:" ) ;
30- Console . Write ( JSONUtils . ToPrettyString ( result ) ) ;
31- Console . WriteLine ( "--------------------------" ) ;
32- Console . WriteLine ( "Expected:" ) ;
33- Console . Write ( JSONUtils . ToPrettyString ( conformanceCase . output ) ) ;
34- Console . WriteLine ( "--------------------------" ) ;
35-
36- Assert . True ( JsonLdUtils . DeepCompare ( result , conformanceCase . output ) , "Returned JSON doesn't match expectations." ) ;
28+ if ( id == "remote-doc-manifest.jsonld#t0005" )
29+ {
30+ Console . WriteLine ( string . Empty ) ;
31+ }
32+ if ( ! JsonLdUtils . DeepCompare ( result , conformanceCase . output ) )
33+ {
34+ #if DEBUG
35+ Console . WriteLine ( id ) ;
36+ Console . WriteLine ( "Actual:" ) ;
37+ Console . Write ( JSONUtils . ToPrettyString ( result ) ) ;
38+ Console . WriteLine ( "--------------------------" ) ;
39+ Console . WriteLine ( "Expected:" ) ;
40+ Console . Write ( JSONUtils . ToPrettyString ( conformanceCase . output ) ) ;
41+ Console . WriteLine ( "--------------------------" ) ;
42+ #endif
43+
44+ Assert . True ( false , "Returned JSON doesn't match expectations." ) ;
45+ }
3746 }
3847 }
3948 }
@@ -99,11 +108,11 @@ public IEnumerator<object[]> GetEnumerator()
99108 {
100109 if ( testType . Any ( ( s ) => new List < string > { "jld:ToRDFTest" , "jld:NormalizeTest" } . Contains ( ( string ) s ) ) )
101110 {
102- newCase . output = File . ReadAllText ( "W3C\\ " + ( string ) testcase [ "expect" ] ) ;
111+ newCase . output = File . ReadAllText ( Path . Combine ( "W3C" , ( string ) testcase [ "expect" ] ) ) ;
103112 }
104113 else if ( testType . Any ( ( s ) => ( string ) s == "jld:FromRDFTest" ) )
105114 {
106- newCase . input = File . ReadAllText ( "W3C\\ " + ( string ) testcase [ "input" ] ) ;
115+ newCase . input = File . ReadAllText ( Path . Combine ( "W3C" , ( string ) testcase [ "input" ] ) ) ;
107116 newCase . output = GetJson ( testcase [ "expect" ] ) ;
108117 }
109118 else
@@ -194,7 +203,7 @@ public IEnumerator<object[]> GetEnumerator()
194203 Func < JToken > innerRun = run ;
195204 run = ( ) =>
196205 {
197- var remoteDoc = options . documentLoader . LoadDocument ( "http ://json-ld.org/test-suite/tests/" + ( string ) testcase [ "input" ] ) ;
206+ var remoteDoc = options . documentLoader . LoadDocument ( "https ://json-ld.org/test-suite/tests/" + ( string ) testcase [ "input" ] ) ;
198207 newCase . input = remoteDoc . Document ;
199208 options . SetBase ( remoteDoc . DocumentUrl ) ;
200209 options . SetExpandContext ( ( JObject ) remoteDoc . Context ) ;
@@ -229,9 +238,10 @@ public IEnumerator<object[]> GetEnumerator()
229238
230239 private JToken GetJson ( JToken j )
231240 {
232- try {
233- if ( j . Type == JTokenType . Null ) return null ;
234- using ( Stream manifestStream = File . OpenRead ( "W3C\\ " + ( string ) j ) )
241+ try
242+ {
243+ if ( j == null || j . Type == JTokenType . Null ) return null ;
244+ using ( Stream manifestStream = File . OpenRead ( Path . Combine ( "W3C" , ( string ) j ) ) )
235245 using ( TextReader reader = new StreamReader ( manifestStream ) )
236246 using ( JsonReader jreader = new Newtonsoft . Json . JsonTextReader ( reader )
237247 {
@@ -241,8 +251,8 @@ private JToken GetJson(JToken j)
241251 return JToken . ReadFrom ( jreader ) ;
242252 }
243253 }
244- catch
245- {
254+ catch ( Exception e )
255+ { // TODO: this should not be here, figure out why this is needed or catch specific exception.
246256 return null ;
247257 }
248258 }
0 commit comments