Added handwritten test for h_action to C#

This commit is contained in:
Dan Hirsch 2014-01-04 22:11:32 +01:00
parent feaf1a7e06
commit ebb7b677ba
5 changed files with 132 additions and 24 deletions

View file

@ -0,0 +1,18 @@
namespace Hammer.Test
{
using NUnit.Framework;
[TestFixture]
public partial class HammerTest
{
[Test]
public void TestAction()
{
Parser parser = Hammer.Action(Hammer.Sequence(Hammer.Choice(Hammer.Token("a"),
Hammer.Token("A")),
Hammer.Choice(Hammer.Token("b"),
Hammer.Token("B"))),
(HAction)(x => char.ToUpper(((string)x)[0])));
}
}
}