More unit tests
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using Upsilon.Evaluator;
|
||||
using Xunit;
|
||||
|
||||
@@ -10,9 +11,18 @@ namespace UpsilonTests.StandardLibraryTests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Assert()
|
||||
public void AssertTest()
|
||||
{
|
||||
new Script("assert(true)", BoundScope, StaticScope).Evaluate();
|
||||
Assert.Throws<Exception>(() => new Script("assert(false)", BoundScope, StaticScope).Evaluate());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Error()
|
||||
{
|
||||
var e = Assert.Throws<Exception>(() =>
|
||||
new Script(@"error(""test_error"")", BoundScope, StaticScope).Evaluate());
|
||||
Assert.Equal("test_error", e.Message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user