Skip to content

Commit b6d4814

Browse files
authored
Merge pull request #7483 from dibarbet/fix_hover_tests
Fix hover tests to actually run and include correct content
2 parents c492b9a + e14a736 commit b6d4814

File tree

2 files changed

+37
-14
lines changed

2 files changed

+37
-14
lines changed

test/integrationTests/hover.integration.tests.ts renamed to test/integrationTests/hover.integration.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import * as vscode from 'vscode';
77
import * as path from 'path';
8+
import { EOL } from 'os';
89
import testAssetWorkspace from './testAssets/testAssetWorkspace';
910
import { activateCSharpExtension, closeAllEditorsAsync, openFileInWorkspaceAsync } from './integrationHelpers';
1011
import { describe, beforeAll, beforeEach, afterAll, test, expect, afterEach } from '@jest/globals';
@@ -35,8 +36,7 @@ describe(`[${testAssetWorkspace.description}] Hover Tests`, () => {
3536
)
3637
);
3738

38-
const expected =
39-
'```csharp\r\nbool testissue.Compare(int gameObject, string tagName)\r\n```\r\n \r\nA cref&nbsp;testissue \r\n**strong text** \r\n_italic text_ \r\n<u>underline text</u> \r\n \r\n•&nbsp;Item 1\\. \r\n•&nbsp;Item 2\\. \r\n \r\n[link text](https://google.com) \r\n \r\nRemarks are cool too\\. \r\n \r\nReturns: \r\n&nbsp;&nbsp;a string \r\n \r\nExceptions: \r\n&nbsp;&nbsp;NullReferenceException \r\n';
39+
const expected = `\`\`\`csharp${EOL}bool testissue.Compare(int gameObject, string tagName)${EOL}\`\`\`${EOL} ${EOL}A cref&nbsp;testissue ${EOL}**strong text** ${EOL}_italic text_ ${EOL}<u>underline text</u> ${EOL} ${EOL}•&nbsp;Item 1\\. ${EOL}•&nbsp;Item 2\\. ${EOL} ${EOL}[link text](https://google.com) ${EOL} ${EOL}Remarks are cool too\\. ${EOL} ${EOL}Returns: ${EOL}&nbsp;&nbsp;a string ${EOL} ${EOL}Exceptions: ${EOL}&nbsp;&nbsp;NullReferenceException ${EOL}`;
4040

4141
expect(hovers.length).toEqual(1);
4242
expect((hovers[0].contents[0] as vscode.MarkdownString).value).toEqual(expected);
Lines changed: 35 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,39 @@
11
using System;
22
namespace Test
33
{
4-
class testissue
5-
{
6-
///<summary>Checks if object is tagged with the tag.</summary>
7-
/// <param name="gameObject">The game object.</param>
8-
/// <param name="tagName">Name of the tag.</param>
9-
/// <returns>Returns <c>true</c> if object is tagged with tag.</returns>
10-
11-
public static bool Compare(int gameObject,string tagName)
12-
{
13-
return true;
14-
}
15-
}
4+
class testissue
5+
{
6+
/// <summary>
7+
/// A cref <see cref="testissue"/>
8+
/// <br/>
9+
/// <strong>strong text</strong>
10+
/// <br/>
11+
/// <em>italic text</em>
12+
/// <br/>
13+
/// <u>underline text</u>
14+
/// <para>
15+
/// <list type='bullet'>
16+
/// <item>
17+
/// <description>Item 1.</description>
18+
/// </item>
19+
/// <item>
20+
/// <description>Item 2.</description>
21+
/// </item>
22+
/// </list>
23+
/// <a href = "https://google.com" > link text</a>
24+
/// </para>
25+
/// </summary>
26+
/// <exception cref='System.NullReferenceException'>
27+
/// Oh no!
28+
/// </exception>
29+
/// <param name='i'>an int</param>
30+
/// <returns>a string</returns>
31+
/// <remarks>
32+
/// Remarks are cool too.
33+
/// </remarks>
34+
public static bool Compare(int gameObject,string tagName)
35+
{
36+
return true;
37+
}
38+
}
1639
}

0 commit comments

Comments
 (0)