Adds simple string library
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using Upsilon;
|
||||
using Upsilon.Evaluator;
|
||||
using Xunit;
|
||||
|
||||
namespace UpsilonTests.StandardLibraryTests
|
||||
|
||||
26
UpsilonTests/StandardLibraryTests/StringLibraryTests.cs
Normal file
26
UpsilonTests/StandardLibraryTests/StringLibraryTests.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user