Skip to content

Commit

Permalink
test: add unmanaged constraint test case (#8773)
Browse files Browse the repository at this point in the history
* test: add unmanaged constraint test case

* test(snapshot): update snapshots for eda37f6

---------

Co-authored-by: yufeih <[email protected]>
  • Loading branch information
yufeih and yufeih authored May 16, 2023
1 parent 5a128f0 commit 6a7347f
Show file tree
Hide file tree
Showing 10 changed files with 215 additions and 28 deletions.
2 changes: 2 additions & 0 deletions samples/seed/dotnet/project/Project/Class1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ public void Issue2723() { }
/// </remarks>
public void Issue4392() { }

public void Issue8764<T>() where T: unmanaged { }

public class Issue8665
{
public int Foo { get; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
},
"id": ".ctor",
"path": "dotnet/project/Project/Class1.cs",
"startLine": 108.0,
"startLine": 110.0,
"endLine": 0.0,
"isExternal": false
},
Expand Down Expand Up @@ -178,7 +178,7 @@
"summary": "",
"platform": null,
"docurl": "https://github.com/dotnet/docfx/new/main/apiSpec/new?filename=BuildFromProject_Class1_Issue8665__ctor.md&value=---%0Auid%3A%20BuildFromProject.Class1.Issue8665.%23ctor%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A",
"sourceurl": "https://github.com/dotnet/docfx/blob/main/samples/seed/dotnet/project/Project/Class1.cs/#L109",
"sourceurl": "https://github.com/dotnet/docfx/blob/main/samples/seed/dotnet/project/Project/Class1.cs/#L111",
"remarks": "",
"conceptual": "",
"implements": "",
Expand Down Expand Up @@ -302,7 +302,7 @@
},
"id": ".ctor",
"path": "dotnet/project/Project/Class1.cs",
"startLine": 110.0,
"startLine": 112.0,
"endLine": 0.0,
"isExternal": false
},
Expand Down Expand Up @@ -359,7 +359,7 @@
"summary": "",
"platform": null,
"docurl": "https://github.com/dotnet/docfx/new/main/apiSpec/new?filename=BuildFromProject_Class1_Issue8665__ctor_System_Int32_.md&value=---%0Auid%3A%20BuildFromProject.Class1.Issue8665.%23ctor(System.Int32)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A",
"sourceurl": "https://github.com/dotnet/docfx/blob/main/samples/seed/dotnet/project/Project/Class1.cs/#L111",
"sourceurl": "https://github.com/dotnet/docfx/blob/main/samples/seed/dotnet/project/Project/Class1.cs/#L113",
"remarks": "",
"conceptual": "",
"implements": "",
Expand Down Expand Up @@ -529,7 +529,7 @@
},
"id": ".ctor",
"path": "dotnet/project/Project/Class1.cs",
"startLine": 112.0,
"startLine": 114.0,
"endLine": 0.0,
"isExternal": false
},
Expand Down Expand Up @@ -586,7 +586,7 @@
"summary": "",
"platform": null,
"docurl": "https://github.com/dotnet/docfx/new/main/apiSpec/new?filename=BuildFromProject_Class1_Issue8665__ctor_System_Int32_System_Char_.md&value=---%0Auid%3A%20BuildFromProject.Class1.Issue8665.%23ctor(System.Int32%2CSystem.Char)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A",
"sourceurl": "https://github.com/dotnet/docfx/blob/main/samples/seed/dotnet/project/Project/Class1.cs/#L113",
"sourceurl": "https://github.com/dotnet/docfx/blob/main/samples/seed/dotnet/project/Project/Class1.cs/#L115",
"remarks": "",
"conceptual": "",
"implements": "",
Expand Down Expand Up @@ -802,7 +802,7 @@
},
"id": ".ctor",
"path": "dotnet/project/Project/Class1.cs",
"startLine": 114.0,
"startLine": 116.0,
"endLine": 0.0,
"isExternal": false
},
Expand Down Expand Up @@ -859,7 +859,7 @@
"summary": "",
"platform": null,
"docurl": "https://github.com/dotnet/docfx/new/main/apiSpec/new?filename=BuildFromProject_Class1_Issue8665__ctor_System_Int32_System_Char_System_String_.md&value=---%0Auid%3A%20BuildFromProject.Class1.Issue8665.%23ctor(System.Int32%2CSystem.Char%2CSystem.String)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A",
"sourceurl": "https://github.com/dotnet/docfx/blob/main/samples/seed/dotnet/project/Project/Class1.cs/#L115",
"sourceurl": "https://github.com/dotnet/docfx/blob/main/samples/seed/dotnet/project/Project/Class1.cs/#L117",
"remarks": "",
"conceptual": "",
"implements": "",
Expand Down Expand Up @@ -989,7 +989,7 @@
},
"id": "Bar",
"path": "dotnet/project/Project/Class1.cs",
"startLine": 105.0,
"startLine": 107.0,
"endLine": 0.0,
"isExternal": false
},
Expand Down Expand Up @@ -1046,7 +1046,7 @@
"summary": "",
"platform": null,
"docurl": "https://github.com/dotnet/docfx/new/main/apiSpec/new?filename=BuildFromProject_Class1_Issue8665_Bar.md&value=---%0Auid%3A%20BuildFromProject.Class1.Issue8665.Bar%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A",
"sourceurl": "https://github.com/dotnet/docfx/blob/main/samples/seed/dotnet/project/Project/Class1.cs/#L106",
"sourceurl": "https://github.com/dotnet/docfx/blob/main/samples/seed/dotnet/project/Project/Class1.cs/#L108",
"remarks": "",
"conceptual": "",
"implements": "",
Expand Down Expand Up @@ -1169,7 +1169,7 @@
},
"id": "Baz",
"path": "dotnet/project/Project/Class1.cs",
"startLine": 106.0,
"startLine": 108.0,
"endLine": 0.0,
"isExternal": false
},
Expand Down Expand Up @@ -1226,7 +1226,7 @@
"summary": "",
"platform": null,
"docurl": "https://github.com/dotnet/docfx/new/main/apiSpec/new?filename=BuildFromProject_Class1_Issue8665_Baz.md&value=---%0Auid%3A%20BuildFromProject.Class1.Issue8665.Baz%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A",
"sourceurl": "https://github.com/dotnet/docfx/blob/main/samples/seed/dotnet/project/Project/Class1.cs/#L107",
"sourceurl": "https://github.com/dotnet/docfx/blob/main/samples/seed/dotnet/project/Project/Class1.cs/#L109",
"remarks": "",
"conceptual": "",
"implements": "",
Expand Down Expand Up @@ -1349,7 +1349,7 @@
},
"id": "Foo",
"path": "dotnet/project/Project/Class1.cs",
"startLine": 104.0,
"startLine": 106.0,
"endLine": 0.0,
"isExternal": false
},
Expand Down Expand Up @@ -1406,7 +1406,7 @@
"summary": "",
"platform": null,
"docurl": "https://github.com/dotnet/docfx/new/main/apiSpec/new?filename=BuildFromProject_Class1_Issue8665_Foo.md&value=---%0Auid%3A%20BuildFromProject.Class1.Issue8665.Foo%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A",
"sourceurl": "https://github.com/dotnet/docfx/blob/main/samples/seed/dotnet/project/Project/Class1.cs/#L105",
"sourceurl": "https://github.com/dotnet/docfx/blob/main/samples/seed/dotnet/project/Project/Class1.cs/#L107",
"remarks": "",
"conceptual": "",
"implements": "",
Expand Down Expand Up @@ -1462,7 +1462,7 @@
},
"id": "Issue8665",
"path": "dotnet/project/Project/Class1.cs",
"startLine": 102.0,
"startLine": 104.0,
"endLine": 0.0,
"isExternal": false
},
Expand Down Expand Up @@ -1940,7 +1940,7 @@
"_tocRel": "toc.html",
"yamlmime": "ManagedReference",
"docurl": "https://github.com/dotnet/docfx/new/main/apiSpec/new?filename=BuildFromProject_Class1_Issue8665.md&value=---%0Auid%3A%20BuildFromProject.Class1.Issue8665%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A",
"sourceurl": "https://github.com/dotnet/docfx/blob/main/samples/seed/dotnet/project/Project/Class1.cs/#L103",
"sourceurl": "https://github.com/dotnet/docfx/blob/main/samples/seed/dotnet/project/Project/Class1.cs/#L105",
"summary": "",
"remarks": "",
"conceptual": "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@
},
"id": ".ctor",
"path": "dotnet/project/Project/Class1.cs",
"startLine": 124.0,
"startLine": 126.0,
"endLine": 0.0,
"isExternal": false
},
Expand Down Expand Up @@ -456,7 +456,7 @@
"summary": "",
"platform": null,
"docurl": "https://github.com/dotnet/docfx/new/main/apiSpec/new?filename=BuildFromProject_Class1_Issue8696Attribute__ctor_System_String_System_Int32_System_Int32_System_String___System_Boolean_System_Type_.md&value=---%0Auid%3A%20BuildFromProject.Class1.Issue8696Attribute.%23ctor(System.String%2CSystem.Int32%2CSystem.Int32%2CSystem.String%5B%5D%2CSystem.Boolean%2CSystem.Type)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A",
"sourceurl": "https://github.com/dotnet/docfx/blob/main/samples/seed/dotnet/project/Project/Class1.cs/#L125",
"sourceurl": "https://github.com/dotnet/docfx/blob/main/samples/seed/dotnet/project/Project/Class1.cs/#L127",
"remarks": "",
"conceptual": "",
"implements": "",
Expand Down Expand Up @@ -512,7 +512,7 @@
},
"id": "Issue8696Attribute",
"path": "dotnet/project/Project/Class1.cs",
"startLine": 122.0,
"startLine": 124.0,
"endLine": 0.0,
"isExternal": false
},
Expand Down Expand Up @@ -2755,7 +2755,7 @@
"_tocRel": "toc.html",
"yamlmime": "ManagedReference",
"docurl": "https://github.com/dotnet/docfx/new/main/apiSpec/new?filename=BuildFromProject_Class1_Issue8696Attribute.md&value=---%0Auid%3A%20BuildFromProject.Class1.Issue8696Attribute%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A",
"sourceurl": "https://github.com/dotnet/docfx/blob/main/samples/seed/dotnet/project/Project/Class1.cs/#L123",
"sourceurl": "https://github.com/dotnet/docfx/blob/main/samples/seed/dotnet/project/Project/Class1.cs/#L125",
"summary": "",
"remarks": "",
"conceptual": "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -857,6 +857,144 @@
"hideTitleType": false,
"hideSubtitle": false
},
{
"uid": "BuildFromProject.Class1.Issue8764``1",
"isEii": false,
"isExtensionMethod": false,
"parent": "BuildFromProject.Class1",
"isExternal": false,
"name": [
{
"lang": "csharp",
"value": "Issue8764<T>()"
},
{
"lang": "vb",
"value": "Issue8764(Of T)()"
}
],
"nameWithType": [
{
"lang": "csharp",
"value": "Class1.Issue8764<T>()"
},
{
"lang": "vb",
"value": "Class1.Issue8764(Of T)()"
}
],
"fullName": [
{
"lang": "csharp",
"value": "BuildFromProject.Class1.Issue8764<T>()"
},
{
"lang": "vb",
"value": "BuildFromProject.Class1.Issue8764(Of T)()"
}
],
"specName": [
{
"lang": "csharp",
"value": "<xref uid=\"BuildFromProject.Class1.Issue8764``1\" text=\"Issue8764&lt;T&gt;()\"/>"
},
{
"lang": "vb",
"value": "<xref uid=\"BuildFromProject.Class1.Issue8764``1\" text=\"Issue8764&lt;T&gt;()\"/>"
}
],
"syntax": {
"content": [
{
"lang": "csharp",
"value": "public void Issue8764<T>() where T : unmanaged"
},
{
"lang": "vb",
"value": "Public Sub Issue8764(Of T As Structure)()"
}
],
"typeParameters": [
{
"id": "T"
}
]
},
"source": {
"remote": {
"path": "samples/seed/dotnet/project/Project/Class1.cs",
"branch": "main",
"repo": "https://github.com/dotnet/docfx"
},
"id": "Issue8764",
"path": "dotnet/project/Project/Class1.cs",
"startLine": 102.0,
"endLine": 0.0,
"isExternal": false
},
"assemblies": [
"BuildFromProject"
],
"namespace": "BuildFromProject",
"overload": {
"uid": "BuildFromProject.Class1.Issue8764*",
"name": [
{
"lang": "csharp",
"value": "Issue8764"
},
{
"lang": "vb",
"value": "Issue8764"
}
],
"nameWithType": [
{
"lang": "csharp",
"value": "Class1.Issue8764"
},
{
"lang": "vb",
"value": "Class1.Issue8764"
}
],
"fullName": [
{
"lang": "csharp",
"value": "BuildFromProject.Class1.Issue8764"
},
{
"lang": "vb",
"value": "BuildFromProject.Class1.Issue8764"
}
],
"specName": [
{
"lang": "csharp",
"value": "<xref uid=\"BuildFromProject.Class1.Issue8764*\" text=\"Issue8764\"/>"
},
{
"lang": "vb",
"value": "<xref uid=\"BuildFromProject.Class1.Issue8764*\" text=\"Issue8764\"/>"
}
],
"id": "BuildFromProject_Class1_Issue8764_"
},
"level": 0.0,
"type": "method",
"summary": "",
"platform": null,
"docurl": "https://github.com/dotnet/docfx/new/main/apiSpec/new?filename=BuildFromProject_Class1_Issue8764__1.md&value=---%0Auid%3A%20BuildFromProject.Class1.Issue8764%60%601%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A",
"sourceurl": "https://github.com/dotnet/docfx/blob/main/samples/seed/dotnet/project/Project/Class1.cs/#L103",
"remarks": "",
"conceptual": "",
"implements": "",
"example": "",
"seealso": null,
"id": "BuildFromProject_Class1_Issue8764__1",
"hideTitleType": false,
"hideSubtitle": false
},
{
"uid": "BuildFromProject.Class1.Issue896",
"isEii": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"api/BuildFromProject.Class1.html": {
"href": "api/BuildFromProject.Class1.html",
"title": "Class Class1 | docfx seed website",
"keywords": "Class Class1 Namespace BuildFromProject Assembly BuildFromProject.dll public class Class1 : IClass1 Inheritance object Class1 Implements IClass1 Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Methods Issue1651() Pricing models are used to calculate theoretical option values 1Black Scholes 2Black76 3Black76Fut 4Equity Tree 5Variance Swap 6Dividend Forecast public void Issue1651() Issue2623() public void Issue2623() Examples MyClass myClass = new MyClass(); void Update() { myClass.Execute(); } Remarks For example: MyClass myClass = new MyClass(); void Update() { myClass.Execute(); } Issue2723() public void Issue2723() Remarks Note This is a <note>. & \" ' Inline <angle brackets>. link for (var i = 0; i > 10; i++) // & \" ' var range = new Range<int> { Min = 0, Max = 10 }; var range = new Range<int> { Min = 0, Max = 10 }; Issue4017() public void Issue4017() Examples public void HookMessageDeleted(BaseSocketClient client) { client.MessageDeleted += HandleMessageDelete; } public Task HandleMessageDelete(Cacheable<IMessage, ulong> cachedMessage, ISocketMessageChannel channel) { // check if the message exists in cache; if not, we cannot report what was removed if (!cachedMessage.HasValue) return; var message = cachedMessage.Value; Console.WriteLine($\"A message ({message.Id}) from {message.Author} was removed from the channel {channel.Name} ({channel.Id}):\" + Environment.NewLine + message.Content); return Task.CompletedTask; } Remarks void Update() { myClass.Execute(); } Issue4392() public void Issue4392() Remarks @\"\\\\?\\\" @\"\\\\?\\\" Issue7484() public void Issue7484() Remarks There's really no reason to not believe that this class can test things. Term Description A Term A Description Bee Term Bee Description Issue896() Test public void Issue896() See Also Class1.Test<T> Class1 XmlCommentIncludeTag() This method should do something... public void XmlCommentIncludeTag() Remarks This is remarks."
"keywords": "Class Class1 Namespace BuildFromProject Assembly BuildFromProject.dll public class Class1 : IClass1 Inheritance object Class1 Implements IClass1 Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Methods Issue1651() Pricing models are used to calculate theoretical option values 1Black Scholes 2Black76 3Black76Fut 4Equity Tree 5Variance Swap 6Dividend Forecast public void Issue1651() Issue2623() public void Issue2623() Examples MyClass myClass = new MyClass(); void Update() { myClass.Execute(); } Remarks For example: MyClass myClass = new MyClass(); void Update() { myClass.Execute(); } Issue2723() public void Issue2723() Remarks Note This is a <note>. & \" ' Inline <angle brackets>. link for (var i = 0; i > 10; i++) // & \" ' var range = new Range<int> { Min = 0, Max = 10 }; var range = new Range<int> { Min = 0, Max = 10 }; Issue4017() public void Issue4017() Examples public void HookMessageDeleted(BaseSocketClient client) { client.MessageDeleted += HandleMessageDelete; } public Task HandleMessageDelete(Cacheable<IMessage, ulong> cachedMessage, ISocketMessageChannel channel) { // check if the message exists in cache; if not, we cannot report what was removed if (!cachedMessage.HasValue) return; var message = cachedMessage.Value; Console.WriteLine($\"A message ({message.Id}) from {message.Author} was removed from the channel {channel.Name} ({channel.Id}):\" + Environment.NewLine + message.Content); return Task.CompletedTask; } Remarks void Update() { myClass.Execute(); } Issue4392() public void Issue4392() Remarks @\"\\\\?\\\" @\"\\\\?\\\" Issue7484() public void Issue7484() Remarks There's really no reason to not believe that this class can test things. Term Description A Term A Description Bee Term Bee Description Issue8764<T>() public void Issue8764<T>() where T : unmanaged Type Parameters T Issue896() Test public void Issue896() See Also Class1.Test<T> Class1 XmlCommentIncludeTag() This method should do something... public void XmlCommentIncludeTag() Remarks This is remarks."
},
"api/BuildFromProject.Class1.Issue8665.html": {
"href": "api/BuildFromProject.Class1.Issue8665.html",
Expand Down
Loading

0 comments on commit 6a7347f

Please sign in to comment.