-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Document sync & completions fix (#192)
## Test plan - Create a new solution - Start adding code - Check if 'grey code' with suggestions appears - Accept the suggestions by pressing `Tab` - Reject the suggestion by pressing `Esc` <!-- REQUIRED; info at https://docs-legacy.sourcegraph.com/dev/background-information/testing_principles --> --------- Co-authored-by: Tomasz Gołębiowski <[email protected]>
- Loading branch information
1 parent
bbe2c1a
commit 8c4074e
Showing
6 changed files
with
43 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using Cody.Core.Common; | ||
using NUnit.Framework; | ||
using NUnit.Framework.Legacy; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Cody.Core.Tests | ||
{ | ||
[TestFixture] | ||
public class StringExtensionsTests | ||
{ | ||
|
||
[TestCase(@"c:\path\to\file", "file:///c%3A/path/to/file")] | ||
[TestCase(@"c:/path/to/file", "file:///c%3A/path/to/file")] | ||
[TestCase(@"c:/file.txt", "file:///c%3A/file.txt")] | ||
public void Can_Convert_Path_To_Valid_Uri(string path, string expectedPath) | ||
{ | ||
var result = StringExtensions.ToUri(path); | ||
|
||
Assert.That(result, Is.EqualTo(expectedPath)); | ||
} | ||
|
||
[TestCase("line1\rline2\rline3\r", "line1\nline2\nline3\n")] | ||
[TestCase("line1\nline2\nline3\n", "line1\nline2\nline3\n")] | ||
[TestCase("line1\r\nline2\r\nline3\r\n", "line1\nline2\nline3\n")] | ||
[TestCase("line1\r\nline2\rline3\n", "line1\nline2\nline3\n")] | ||
public void Can_Replace_Line_Brakers(string text, string expectedText) | ||
{ | ||
var result = StringExtensions.ConvertLineBreaks(text, "\n"); | ||
|
||
Assert.That(result, Is.EqualTo(expectedText)); | ||
} | ||
} | ||
} |
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