Implements new debug string that outlines the bound script
This commit is contained in:
@@ -153,5 +153,21 @@ namespace PorygonSharpTests
|
||||
var hash = "Foo".ScriptHash();
|
||||
Assert.AreEqual(193501609, hash);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestBoundTreeString()
|
||||
{
|
||||
using (var script = new Script("return 10 + 500"))
|
||||
{
|
||||
var tree = script.GetBoundTreeString();
|
||||
const string expectedString = @"BlockStatement
|
||||
ReturnStatement
|
||||
BinaryExpression: addition (number)
|
||||
LiteralInteger: 10 (number)
|
||||
LiteralInteger: 500 (number)";
|
||||
Assert.AreEqual(expectedString, tree);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user