mirror of
https://github.com/Smaug123/unofficial-nunit-runner
synced 2025-12-15 01:35:39 +00:00
Compare commits
1 Commits
WoofWare.N
...
WoofWare.N
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d1dde56d06 |
@@ -108,7 +108,8 @@ module internal Lexer =
|
||||
i <- i + 1
|
||||
| _ ->
|
||||
yield Token.single TokenType.Not startI 1
|
||||
i <- i + 1
|
||||
// Don't advance i here - we only consumed the '!' character
|
||||
()
|
||||
| Token.SingleChar token, State.Awaiting ->
|
||||
i <- i + 1
|
||||
yield token
|
||||
@@ -162,7 +163,7 @@ module internal ParsedFilter =
|
||||
|
||||
match token.Type with
|
||||
| TokenType.QuotedString ->
|
||||
// +1 and -1, because the trivia contains the initial and terminal quote mark
|
||||
// +1 to skip the initial quote; len includes the initial quote but excludes the terminal quote
|
||||
inputString.Substring (start + 1, len - 1)
|
||||
|> unescape
|
||||
|> ParsedFilter.String
|
||||
|
||||
@@ -123,3 +123,15 @@ module TestFilter =
|
||||
[<TestCaseSource(nameof xmlExamples)>]
|
||||
let ``XML examples`` (example : string, expected : Filter) =
|
||||
Filter.parse example |> shouldEqual expected
|
||||
|
||||
let negationExamples =
|
||||
[
|
||||
"!Name=foo", Filter.Not (Filter.Name (Match.Exact "foo"))
|
||||
"!FullyQualifiedName=bar", Filter.Not (Filter.FullyQualifiedName (Match.Exact "bar"))
|
||||
"!TestCategory=baz", Filter.Not (Filter.TestCategory (Match.Exact "baz"))
|
||||
]
|
||||
|> List.map TestCaseData
|
||||
|
||||
[<TestCaseSource(nameof negationExamples)>]
|
||||
let ``Negation examples`` (example : string, expected : Filter) =
|
||||
Filter.parse example |> shouldEqual expected
|
||||
|
||||
Reference in New Issue
Block a user