-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* accelerate tests * Update src/Neo.SmartContract.Testing/Coverage/CoverageHit.cs * Update CoverageHit.cs * bool tryDecodeOperand * revert to simple description * refactor CoverageHit * Update CoverageHit.cs * Update src/Neo.SmartContract.Testing/Coverage/CoverageHit.cs --------- Co-authored-by: Shargon <[email protected]> Co-authored-by: Jimmy <[email protected]>
- Loading branch information
1 parent
d59d0b8
commit 0239e1d
Showing
9 changed files
with
63 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...r.CSharp.UnitTests/UnitTest_Parameters.cs → ...itTests/Peripheral/UnitTest_Parameters.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
tests/Neo.Compiler.CSharp.UnitTests/Peripheral/UnitTest_PrivateMethod.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
using Neo.SmartContract.Testing; | ||
using System.IO; | ||
using System.Numerics; | ||
using System.Text; | ||
|
||
namespace Neo.Compiler.CSharp.UnitTests.Peripheral | ||
{ | ||
[TestClass] | ||
public class UnitTest_PrivateMethod : DebugAndTestBase<Contract1> | ||
{ | ||
[TestMethod] | ||
public void Test_PrivateMethod() | ||
{ | ||
// Optimizer will remove this method | ||
Assert.IsFalse(Encoding.ASCII.GetString(Contract1.Nef.Script.Span).Contains("NEO3")); | ||
|
||
// Compile without optimizations | ||
|
||
var testContractsPath = new FileInfo("../../../../Neo.Compiler.CSharp.TestContracts/Contract1.cs").FullName; | ||
var results = new CompilationEngine(new CompilationOptions() | ||
{ | ||
Debug = CompilationOptions.DebugType.Extended, | ||
CompilerVersion = "TestingEngine", | ||
Optimize = CompilationOptions.OptimizationType.None, | ||
Nullable = Microsoft.CodeAnalysis.NullableContextOptions.Enable | ||
}) | ||
.CompileSources(testContractsPath); | ||
|
||
Assert.AreEqual(1, results.Count); | ||
Assert.IsTrue(results[0].Success); | ||
|
||
var nef = results[0].CreateExecutable(); | ||
Assert.IsTrue(Encoding.ASCII.GetString(nef.Script.Span).Contains("NEO3")); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters