Skip to content

Commit

Permalink
Add a few tests for an issue under open investigation
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenaw committed Nov 9, 2024
1 parent d238d33 commit e8a0365
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
// Copyright (c) Charlie Poole, Rob Prouse and Contributors. MIT License - see LICENSE.txt

using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
using NUnit.Framework;

namespace NUnit.Engine.Tests
{
Expand Down Expand Up @@ -40,6 +38,7 @@ public void CreateParser()
[TestCase("test='My.Test.Fixture.Method(\"abc\\'s\")'", "<test>My.Test.Fixture.Method(&quot;abc&apos;s&quot;)</test>")]
[TestCase("test='My.Test.Fixture.Method(\"x&y&z\")'", "<test>My.Test.Fixture.Method(&quot;x&amp;y&amp;z&quot;)</test>")]
[TestCase("test='My.Test.Fixture.Method(\"<xyz>\")'", "<test>My.Test.Fixture.Method(&quot;&lt;xyz&gt;&quot;)</test>")]
[TestCase("test=='Issue1510.TestSomething(Option1,\"ABC\")'", "<test>Issue1510.TestSomething(Option1,&quot;ABC&quot;)</test>")]
[TestCase("cat==Urgent && test=='My.Tests'", "<and><cat>Urgent</cat><test>My.Tests</test></and>")]
[TestCase("cat==Urgent and test=='My.Tests'", "<and><cat>Urgent</cat><test>My.Tests</test></and>")]
[TestCase("cat==Urgent || test=='My.Tests'", "<or><cat>Urgent</cat><test>My.Tests</test></or>")]
Expand Down
16 changes: 13 additions & 3 deletions src/NUnitEngine/nunit.engine.tests/Services/TokenizerTests.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
// Copyright (c) Charlie Poole, Rob Prouse and Contributors. MIT License - see LICENSE.txt

using System;
using System.Collections.Generic;
using System.Text;
using NUnit.Framework;

namespace NUnit.Engine.Tests
Expand Down Expand Up @@ -75,6 +72,19 @@ public void StringWithSlashes()
Assert.That(tokenizer.NextToken(), Is.EqualTo(new Token(TokenKind.Eof)));
}

[Test]
public void TestNameWithParameters()
{
var tokenizer = new Tokenizer("test==Issue1510.TestSomething(Option1,\"ABC\")");
Assert.That(tokenizer.NextToken(), Is.EqualTo(new Token(TokenKind.Word, "test")));
Assert.That(tokenizer.NextToken(), Is.EqualTo(new Token(TokenKind.Symbol, "==")));
Assert.That(tokenizer.NextToken(), Is.EqualTo(new Token(TokenKind.Word, "Issue1510.TestSomething")));
Assert.That(tokenizer.NextToken(), Is.EqualTo(new Token(TokenKind.Symbol, "(")));
Assert.That(tokenizer.NextToken(), Is.EqualTo(new Token(TokenKind.Word, "Option1,\"ABC\"")));
Assert.That(tokenizer.NextToken(), Is.EqualTo(new Token(TokenKind.Symbol, ")")));
Assert.That(tokenizer.NextToken(), Is.EqualTo(new Token(TokenKind.Eof)));
}

[Test]
public void StringsMayContainEscapedQuoteChar()
{
Expand Down

0 comments on commit e8a0365

Please sign in to comment.