Upsilon/UpsilonTests/GeneralTests/LengthOperatorTests.cs

27 lines
765 B
C#

using Upsilon.Binder;
using Upsilon.Evaluator;
using Upsilon.StandardLibraries;
using Xunit;
namespace UpsilonTests.GeneralTests
{
public class LengthOperatorTests : TestClass
{
public LengthOperatorTests(StaticScriptFixture fix) : base(fix)
{
}
[Theory]
[InlineData(@"#""test""", 4)]
[InlineData(@"#{100,50,60,7863,1564,12354,10354}", 7)]
public void Test(string input, long expectedOutput)
{
var script = new Script(input, BoundScope, StaticScope);
Assert.Empty(script.Diagnostics.Messages);
var actual = script.Evaluate<long>();
Assert.Empty(script.Diagnostics.Messages);
Assert.Equal(expectedOutput, actual);
}
}
}