-
Notifications
You must be signed in to change notification settings - Fork 381
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expand combinatorial testing of HTTP parser (#3166)
* add combinatorial tests for extra trivia and progressively typed code * improve comment parsing; more combinatorial testing * PR feedback * fix for leading request separator; CurrentToken => null instead of throw * remove redundant GetDefaultKernelName logic * update API baseline
- Loading branch information
1 parent
34cc09c
commit c13d287
Showing
16 changed files
with
425 additions
and
459 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
src/Microsoft.DotNet.Interactive.HttpRequest.Tests/ParserTests.RequestSeparator.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Copyright (c) .NET Foundation and contributors. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
using FluentAssertions; | ||
using Microsoft.DotNet.Interactive.HttpRequest.Tests.Utility; | ||
using Xunit; | ||
|
||
namespace Microsoft.DotNet.Interactive.HttpRequest.Tests; | ||
|
||
public partial class ParserTests | ||
{ | ||
public class RequestSeparator | ||
{ | ||
|
||
[Fact] | ||
public void request_separator_at_start_of_request_is_valid() | ||
{ | ||
var code = """ | ||
### | ||
GET https://example.com | ||
"""; | ||
|
||
var result = Parse(code); | ||
|
||
result.SyntaxTree.RootNode.ChildNodes | ||
.Should().ContainSingle<HttpRequestNode>() | ||
.Which.UrlNode.Text.Should().Be("https://example.com"); | ||
} | ||
|
||
} | ||
} |
Oops, something went wrong.