From d106b605e5156d8a9b6932aea9f8f420195c9417 Mon Sep 17 00:00:00 2001 From: stevenaw Date: Fri, 8 Nov 2024 21:32:05 -0500 Subject: [PATCH] Add a few tests for an issue under open investigation --- .../Services/TestSelectionParserTests.cs | 5 ++--- .../Services/TokenizerTests.cs | 16 +++++++++++++--- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/NUnitEngine/nunit.engine.tests/Services/TestSelectionParserTests.cs b/src/NUnitEngine/nunit.engine.tests/Services/TestSelectionParserTests.cs index a067bc972..47500507a 100644 --- a/src/NUnitEngine/nunit.engine.tests/Services/TestSelectionParserTests.cs +++ b/src/NUnitEngine/nunit.engine.tests/Services/TestSelectionParserTests.cs @@ -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 { @@ -40,6 +38,7 @@ public void CreateParser() [TestCase("test='My.Test.Fixture.Method(\"abc\\'s\")'", "My.Test.Fixture.Method("abc's")")] [TestCase("test='My.Test.Fixture.Method(\"x&y&z\")'", "My.Test.Fixture.Method("x&y&z")")] [TestCase("test='My.Test.Fixture.Method(\"\")'", "My.Test.Fixture.Method("<xyz>")")] + [TestCase("test=='Issue1510.TestSomething(Option1,\"ABC\")'", "Issue1510.TestSomething(Option1,"ABC")")] [TestCase("cat==Urgent && test=='My.Tests'", "UrgentMy.Tests")] [TestCase("cat==Urgent and test=='My.Tests'", "UrgentMy.Tests")] [TestCase("cat==Urgent || test=='My.Tests'", "UrgentMy.Tests")] diff --git a/src/NUnitEngine/nunit.engine.tests/Services/TokenizerTests.cs b/src/NUnitEngine/nunit.engine.tests/Services/TokenizerTests.cs index 29c826a76..8a55594df 100644 --- a/src/NUnitEngine/nunit.engine.tests/Services/TokenizerTests.cs +++ b/src/NUnitEngine/nunit.engine.tests/Services/TokenizerTests.cs @@ -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 @@ -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() {