Upsilon/UpsilonTests/StandardLibraryTests/StringLibraryTests.cs

26 lines
624 B
C#

using Upsilon;
using Xunit;
namespace UpsilonTests.StandardLibraryTests
{
public class StringLibraryTests : TestClass
{
public StringLibraryTests(StaticScriptFixture fix) : base(fix)
{
}
[Fact]
public void ByteUse()
{
var result = Executor.EvaluateScript<long>(@"string.byte(""a"")", Options);
Assert.Equal('a', result);
}
[Fact]
public void ByteUseIndex()
{
var result = Executor.EvaluateScript<long>(@"string.byte(""abcd"", 3)", Options);
Assert.Equal('c', result);
}
}
}