File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
tests/Neo.UnitTests/SmartContract/Native Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -300,6 +300,8 @@ public void TestGenerateNativeContractApi()
300300
301301 var docsDirectory = LocateDocsDirectory ( new DirectoryInfo ( Directory . GetCurrentDirectory ( ) ) ) ;
302302 var outputPath = Path . Combine ( docsDirectory . FullName , "native-contracts-api.md" ) ;
303+ var previousContent = File . Exists ( outputPath ) ? File . ReadAllText ( outputPath ) : "" ;
304+
303305 using ( var writer = new StreamWriter ( outputPath ) { NewLine = "\n " } )
304306 {
305307 writer . WriteLine ( """
@@ -332,6 +334,11 @@ 3. A native contract method may have different behaviors in different hardforks.
332334 }
333335
334336 Assert . IsTrue ( File . Exists ( outputPath ) , $ "Generated file should exist at { outputPath } ") ;
337+
338+ if ( ! string . IsNullOrEmpty ( previousContent ) )
339+ {
340+ Assert . AreEqual ( previousContent . Trim ( ) , File . ReadAllText ( outputPath ) . Trim ( ) , "Native contract api file was changed!" ) ;
341+ }
335342 }
336343
337344 private static DirectoryInfo LocateDocsDirectory ( DirectoryInfo start )
You can’t perform that action at this time.
0 commit comments