You've already forked linux-packaging-mono
acceptance-tests
data
debian
docs
external
Newtonsoft.Json
api-doc-tools
api-snapshot
aspnetwebstack
packages
src
test
Microsoft.TestCommon
Microsoft.Web.Helpers.Test
Microsoft.Web.Http.Data.Test
Microsoft.Web.Mvc.Test
Microsoft.Web.WebPages.OAuth.Test
SPA.Test
System.Json.Test.Integration
System.Json.Test.Unit
System.Net.Http.Formatting.Test.Integration
System.Net.Http.Formatting.Test.Unit
System.Web.Helpers.Test
System.Web.Http.Integration.Test
System.Web.Http.SelfHost.Test
System.Web.Http.Test
System.Web.Http.WebHost.Test
System.Web.Mvc.Test
System.Web.Razor.Test
Editor
Framework
Generator
Parser
Properties
TestFiles
Text
Tokenizer
CSharpTokenizerCommentTest.cs
CSharpTokenizerIdentifierTest.cs
CSharpTokenizerLiteralTest.cs
CSharpTokenizerOperatorsTest.cs
CSharpTokenizerTest.cs
CSharpTokenizerTestBase.cs
HtmlTokenizerTest.cs
HtmlTokenizerTestBase.cs
TokenizerLookaheadTest.cs
TokenizerTestBase.cs
VBTokenizerCommentTest.cs
VBTokenizerIdentifierTest.cs
VBTokenizerLiteralTest.cs
VBTokenizerOperatorsTest.cs
VBTokenizerTest.cs
VBTokenizerTestBase.cs
Utils
CSharpRazorCodeLanguageTest.cs
CodeCompileUnitExtensions.cs
RazorCodeLanguageTest.cs
RazorDirectiveAttributeTest.cs
RazorEngineHostTest.cs
RazorTemplateEngineTest.cs
StringTextBuffer.cs
System.Web.Razor.Test.csproj
VBRazorCodeLanguageTest.cs
packages.config
System.Web.WebPages.Administration.Test
System.Web.WebPages.Deployment.Test
System.Web.WebPages.Razor.Test
System.Web.WebPages.Test
WebMatrix.Data.Test
WebMatrix.WebData.Test
Settings.StyleCop
tools
.gitattributes
.gitignore
License.txt
README.md
Runtime.msbuild
Runtime.sln
Runtime.xunit
Settings.StyleCop
build.cmd
binary-reference-assemblies
bockbuild
boringssl
cecil
cecil-legacy
corefx
corert
ikdasm
ikvm
linker
nuget-buildtasks
nunit-lite
roslyn-binaries
rx
xunit-binaries
ikvm-native
libgc
llvm
m4
man
mcs
mk
mono
msvc
po
runtime
samples
scripts
support
tools
COPYING.LIB
LICENSE
Makefile.am
Makefile.in
NEWS
README.md
acinclude.m4
aclocal.m4
autogen.sh
code_of_conduct.md
compile
config.guess
config.h.in
config.rpath
config.sub
configure.REMOVED.git-id
configure.ac.REMOVED.git-id
depcomp
install-sh
ltmain.sh.REMOVED.git-id
missing
mkinstalldirs
mono-uninstalled.pc.in
test-driver
winconfig.h
94 lines
3.7 KiB
C#
94 lines
3.7 KiB
C#
![]() |
// Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information.
|
|||
|
|
|||
|
using System.Web.Razor.Tokenizer.Symbols;
|
|||
|
using Xunit;
|
|||
|
|
|||
|
namespace System.Web.Razor.Test.Tokenizer
|
|||
|
{
|
|||
|
public class VBTokenizerCommentTest : VBTokenizerTestBase
|
|||
|
{
|
|||
|
[Fact]
|
|||
|
public void Next_Ignores_Star_At_EOF_In_RazorComment()
|
|||
|
{
|
|||
|
TestTokenizer("@* Foo * Bar * Baz *",
|
|||
|
new VBSymbol(0, 0, 0, "@", VBSymbolType.RazorCommentTransition),
|
|||
|
new VBSymbol(1, 0, 1, "*", VBSymbolType.RazorCommentStar),
|
|||
|
new VBSymbol(2, 0, 2, " Foo * Bar * Baz *", VBSymbolType.RazorComment));
|
|||
|
}
|
|||
|
|
|||
|
[Fact]
|
|||
|
public void Next_Ignores_Star_Without_Trailing_At()
|
|||
|
{
|
|||
|
TestTokenizer("@* Foo * Bar * Baz *@",
|
|||
|
new VBSymbol(0, 0, 0, "@", VBSymbolType.RazorCommentTransition),
|
|||
|
new VBSymbol(1, 0, 1, "*", VBSymbolType.RazorCommentStar),
|
|||
|
new VBSymbol(2, 0, 2, " Foo * Bar * Baz ", VBSymbolType.RazorComment),
|
|||
|
new VBSymbol(19, 0, 19, "*", VBSymbolType.RazorCommentStar),
|
|||
|
new VBSymbol(20, 0, 20, "@", VBSymbolType.RazorCommentTransition));
|
|||
|
}
|
|||
|
|
|||
|
[Fact]
|
|||
|
public void Next_Returns_RazorComment_Token_For_Entire_Razor_Comment()
|
|||
|
{
|
|||
|
TestTokenizer("@* Foo Bar Baz *@",
|
|||
|
new VBSymbol(0, 0, 0, "@", VBSymbolType.RazorCommentTransition),
|
|||
|
new VBSymbol(1, 0, 1, "*", VBSymbolType.RazorCommentStar),
|
|||
|
new VBSymbol(2, 0, 2, " Foo Bar Baz ", VBSymbolType.RazorComment),
|
|||
|
new VBSymbol(15, 0, 15, "*", VBSymbolType.RazorCommentStar),
|
|||
|
new VBSymbol(16, 0, 16, "@", VBSymbolType.RazorCommentTransition));
|
|||
|
}
|
|||
|
|
|||
|
[Fact]
|
|||
|
public void Tick_Comment_Is_Recognized()
|
|||
|
{
|
|||
|
TestTokenizer("' Foo Bar Baz", new VBSymbol(0, 0, 0, "' Foo Bar Baz", VBSymbolType.Comment));
|
|||
|
}
|
|||
|
|
|||
|
[Fact]
|
|||
|
public void Tick_Comment_Is_Terminated_By_Newline()
|
|||
|
{
|
|||
|
TestTokenizer("' Foo Bar Baz\na", new VBSymbol(0, 0, 0, "' Foo Bar Baz", VBSymbolType.Comment), IgnoreRemaining);
|
|||
|
}
|
|||
|
|
|||
|
[Fact]
|
|||
|
public void LeftQuote_Comment_Is_Recognized()
|
|||
|
{
|
|||
|
// U+2018 - Left Quote: ‘
|
|||
|
TestTokenizer("‘ Foo Bar Baz", new VBSymbol(0, 0, 0, "‘ Foo Bar Baz", VBSymbolType.Comment));
|
|||
|
}
|
|||
|
|
|||
|
[Fact]
|
|||
|
public void LeftQuote_Comment_Is_Terminated_By_Newline()
|
|||
|
{
|
|||
|
// U+2018 - Left Quote: ‘
|
|||
|
TestTokenizer("‘ Foo Bar Baz\na", new VBSymbol(0, 0, 0, "‘ Foo Bar Baz", VBSymbolType.Comment), IgnoreRemaining);
|
|||
|
}
|
|||
|
|
|||
|
[Fact]
|
|||
|
public void RightQuote_Comment_Is_Recognized()
|
|||
|
{
|
|||
|
// U+2019 - Right Quote: ’
|
|||
|
TestTokenizer("’ Foo Bar Baz", new VBSymbol(0, 0, 0, "’ Foo Bar Baz", VBSymbolType.Comment));
|
|||
|
}
|
|||
|
|
|||
|
[Fact]
|
|||
|
public void RightQuote_Comment_Is_Terminated_By_Newline()
|
|||
|
{
|
|||
|
// U+2019 - Right Quote: ’
|
|||
|
TestTokenizer("’ Foo Bar Baz\na", new VBSymbol(0, 0, 0, "’ Foo Bar Baz", VBSymbolType.Comment), IgnoreRemaining);
|
|||
|
}
|
|||
|
|
|||
|
[Fact]
|
|||
|
public void Rem_Comment_Is_Recognized()
|
|||
|
{
|
|||
|
TestTokenizer("REM Foo Bar Baz", new VBSymbol(0, 0, 0, "REM Foo Bar Baz", VBSymbolType.Comment));
|
|||
|
}
|
|||
|
|
|||
|
[Fact]
|
|||
|
public void Rem_Comment_Is_Terminated_By_Newline()
|
|||
|
{
|
|||
|
TestTokenizer("REM Foo Bar Baz\na", new VBSymbol(0, 0, 0, "REM Foo Bar Baz", VBSymbolType.Comment), IgnoreRemaining);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|