Skip to content

Commit c526b45

Browse files
committed
Add fix-usings-with-empty-line regression tests
1 parent 4a73854 commit c526b45

File tree

1 file changed

+70
-0
lines changed

1 file changed

+70
-0
lines changed

test/fixusings.vader

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,76 @@ Expect cs(should add another required using):
105105
}
106106

107107

108+
Given cs():
109+
using System;
110+
111+
using System.Text;
112+
113+
public class Test
114+
{
115+
public Test()
116+
{
117+
Console.WriteLine(Encoding.UTF8.ToString());
118+
Console.WriteLine(DateTime.Parse("1999-01-01T00:01:01Z", CultureInfo.InvariantCulture));
119+
}
120+
}
121+
122+
Execute (run fix usings with empty line and virtualedit=):
123+
call OmniSharpTestInitializeBuffer('FixUsings4')
124+
set virtualedit=
125+
call OmniSharpWarmup('OmniSharp#actions#usings#Fix', [])
126+
call OmniSharpTestAwait('OmniSharp#actions#usings#Fix', [])
127+
128+
Expect cs(should add another required using between the others):
129+
using System;
130+
using System.Globalization;
131+
using System.Text;
132+
133+
public class Test
134+
{
135+
public Test()
136+
{
137+
Console.WriteLine(Encoding.UTF8.ToString());
138+
Console.WriteLine(DateTime.Parse("1999-01-01T00:01:01Z", CultureInfo.InvariantCulture));
139+
}
140+
}
141+
142+
143+
Given cs():
144+
using System;
145+
146+
using System.Text;
147+
148+
public class Test
149+
{
150+
public Test()
151+
{
152+
Console.WriteLine(Encoding.UTF8.ToString());
153+
Console.WriteLine(DateTime.Parse("1999-01-01T00:01:01Z", CultureInfo.InvariantCulture));
154+
}
155+
}
156+
157+
Execute (run fix usings with empty line and virtualedit=all):
158+
call OmniSharpTestInitializeBuffer('FixUsings4')
159+
set virtualedit=all
160+
call OmniSharpWarmup('OmniSharp#actions#usings#Fix', [])
161+
call OmniSharpTestAwait('OmniSharp#actions#usings#Fix', [])
162+
163+
Expect cs(should add another required using between the others):
164+
using System;
165+
using System.Globalization;
166+
using System.Text;
167+
168+
public class Test
169+
{
170+
public Test()
171+
{
172+
Console.WriteLine(Encoding.UTF8.ToString());
173+
Console.WriteLine(DateTime.Parse("1999-01-01T00:01:01Z", CultureInfo.InvariantCulture));
174+
}
175+
}
176+
177+
108178
Given cs():
109179
public class test {
110180
class1 ns1 = new class1();

0 commit comments

Comments
 (0)