Skip to content

Commit

Permalink
Added unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
michal.hosala committed Apr 25, 2016
1 parent 6c9cf0a commit 7ef2e05
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/Workspaces/VisualBasicTest/Formatting/FormattingTests.vb
Original file line number Diff line number Diff line change
Expand Up @@ -1774,6 +1774,33 @@ End Class</Code>
Await AssertFormatAsync(code, expected, changedOptionSet:=optionSet)
End Function

<Fact, Trait(Traits.Feature, Traits.Features.Formatting)>
<WorkItem(10742, "https://github.com/dotnet/roslyn/issues/10742")>
Public Async Function ReFormatWithTabsEnabled6() As Task
Dim code =
"Class SomeClass" + vbCrLf +
" Sub Foo() ' Comment" + vbCrLf +
" Foo()" + vbCrLf +
" End Sub" + vbCrLf +
"End Class"

Dim expected =
"Class SomeClass" + vbCrLf +
vbTab + "Sub Foo() ' Comment" + vbCrLf +
vbTab + vbTab + "Foo()" + vbCrLf +
vbTab + "End Sub" + vbCrLf +
"End Class"

Dim optionSet = New Dictionary(Of OptionKey, Object) From
{
{New OptionKey(FormattingOptions.UseTabs, LanguageNames.VisualBasic), True},
{New OptionKey(FormattingOptions.TabSize, LanguageNames.VisualBasic), 4},
{New OptionKey(FormattingOptions.IndentationSize, LanguageNames.VisualBasic), 4}
}

Await AssertFormatAsync(code, expected, changedOptionSet:=optionSet)
End Function

<Fact, Trait(Traits.Feature, Traits.Features.Formatting)>
Public Async Function ReFormatWithTabsDisabled() As Task
Dim code =
Expand Down

0 comments on commit 7ef2e05

Please sign in to comment.