Implements new debug string that outlines the bound script

This commit is contained in:
2019-09-07 12:18:28 +02:00
parent 8f5c165d39
commit 93ae52b04a
4 changed files with 29 additions and 2 deletions

View File

@@ -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);
}
}
}
}