From 9bd2fdecac9811083662489be5442ce1107c5e08 Mon Sep 17 00:00:00 2001
From: "N. Taylor Mullen"
Date: Mon, 12 May 2014 15:05:18 -0700
Subject: [PATCH] Modified tests to account for await accepting dots.
#45
---
.../Generator/CSharpRazorCodeGeneratorTest.cs | 14 +++++-----
.../CS/Output/Await.DesignTime.cs | 21 +++++++++++----
.../CodeGenerator/CS/Output/Await.cs | 26 +++++++++++++++----
.../CodeGenerator/CS/Source/Await.cshtml | 2 ++
4 files changed, 47 insertions(+), 16 deletions(-)
diff --git a/test/Microsoft.AspNet.Razor.Test/Generator/CSharpRazorCodeGeneratorTest.cs b/test/Microsoft.AspNet.Razor.Test/Generator/CSharpRazorCodeGeneratorTest.cs
index 935b8a6f82..286c00fb68 100644
--- a/test/Microsoft.AspNet.Razor.Test/Generator/CSharpRazorCodeGeneratorTest.cs
+++ b/test/Microsoft.AspNet.Razor.Test/Generator/CSharpRazorCodeGeneratorTest.cs
@@ -109,12 +109,14 @@ namespace Microsoft.AspNet.Razor.Test.Generator
BuildLineMapping(391, 12, 66, 1066, 58, 18, 1),
BuildLineMapping(448, 13, 49, 1146, 64, 19, 5),
BuildLineMapping(578, 18, 42, 1225, 69, 15, 15),
- BuildLineMapping(640, 19, 41, 1316, 74, 17, 22),
- BuildLineMapping(711, 20, 42, 1409, 79, 12, 39),
- BuildLineMapping(806, 21, 49, 1521, 85, 13, 1),
- BuildLineMapping(811, 21, 54, 1600, 91, 18, 27),
- BuildLineMapping(842, 21, 85, 1708, 96, 22, 1),
- BuildLineMapping(902, 22, 52, 1788, 102, 19, 19)
+ BuildLineMapping(650, 19, 51, 1317, 74, 18, 19),
+ BuildLineMapping(716, 20, 41, 1412, 79, 17, 22),
+ BuildLineMapping(787, 21, 42, 1505, 84, 12, 39),
+ BuildLineMapping(884, 22, 51, 1619, 90, 15, 21),
+ BuildLineMapping(961, 23, 49, 1713, 96, 13, 1),
+ BuildLineMapping(966, 23, 54, 1792, 102, 18, 27),
+ BuildLineMapping(997, 23, 85, 1900, 107, 22, 1),
+ BuildLineMapping(1057, 24, 52, 1980, 113, 19, 19)
});
}
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/CS/Output/Await.DesignTime.cs b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/CS/Output/Await.DesignTime.cs
index e8404ce772..f117f36014 100644
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/CS/Output/Await.DesignTime.cs
+++ b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/CS/Output/Await.DesignTime.cs
@@ -72,34 +72,45 @@ namespace TestOutput
#line default
#line hidden
#line 20 "Await.cshtml"
- __o = await Foo("bob", true);
+ __o = await Foo.Bar(1, 2);
#line default
#line hidden
#line 21 "Await.cshtml"
+ __o = await Foo("bob", true);
+
+#line default
+#line hidden
+#line 22 "Await.cshtml"
await Foo(something, hello: "world");
#line default
#line hidden
-#line 22 "Await.cshtml"
+#line 23 "Await.cshtml"
+ await Foo.Bar(1, 2)
+
+#line default
+#line hidden
+
+#line 24 "Await.cshtml"
#line default
#line hidden
-#line 22 "Await.cshtml"
+#line 24 "Await.cshtml"
__o = await Foo(boolValue: false);
#line default
#line hidden
-#line 22 "Await.cshtml"
+#line 24 "Await.cshtml"
#line default
#line hidden
-#line 23 "Await.cshtml"
+#line 25 "Await.cshtml"
__o = await ("wrrronggg");
#line default
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/CS/Output/Await.cs b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/CS/Output/Await.cs
index 163e06b399..0de02b096c 100644
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/CS/Output/Await.cs
+++ b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/CS/Output/Await.cs
@@ -83,9 +83,18 @@ namespace TestOutput
#line hidden
);
- WriteLiteral("
\r\n Advanced Asynchronous Template: ");
+ WriteLiteral("
\r\n Advanced Asynchronous Expression Extended: ");
Write(
#line 20 "Await.cshtml"
+ await Foo.Bar(1, 2)
+
+#line default
+#line hidden
+ );
+
+ WriteLiteral("
\r\n Advanced Asynchronous Template: ");
+ Write(
+#line 21 "Await.cshtml"
await Foo("bob", true)
#line default
@@ -93,15 +102,22 @@ namespace TestOutput
);
WriteLiteral("
\r\n Advanced Asynchronous Statement: ");
-#line 21 "Await.cshtml"
+#line 22 "Await.cshtml"
await Foo(something, hello: "world");
+#line default
+#line hidden
+
+ WriteLiteral("
\r\n Advanced Asynchronous Statement Extended: ");
+#line 23 "Await.cshtml"
+ await Foo.Bar(1, 2)
+
#line default
#line hidden
WriteLiteral("
\r\n Advanced Asynchronous Statement Nested: ");
Write(
-#line 22 "Await.cshtml"
+#line 24 "Await.cshtml"
await Foo(boolValue: false)
#line default
@@ -109,7 +125,7 @@ namespace TestOutput
);
WriteLiteral(" ");
-#line 22 "Await.cshtml"
+#line 24 "Await.cshtml"
#line default
@@ -117,7 +133,7 @@ namespace TestOutput
WriteLiteral("
\r\n Advanced Incomplete Asynchronous Statement: ");
Write(
-#line 23 "Await.cshtml"
+#line 25 "Await.cshtml"
await ("wrrronggg")
#line default
diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/CS/Source/Await.cshtml b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/CS/Source/Await.cshtml
index 5c034a224f..69b68e07c5 100644
--- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/CS/Source/Await.cshtml
+++ b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/CS/Source/Await.cshtml
@@ -17,8 +17,10 @@
Advanced Asynchronous Expression Test
Advanced Asynchronous Expression: @await Foo(1, 2)
+ Advanced Asynchronous Expression Extended: @await Foo.Bar(1, 2)
Advanced Asynchronous Template: @(await Foo("bob", true))
Advanced Asynchronous Statement: @{ await Foo(something, hello: "world"); }
+ Advanced Asynchronous Statement Extended: @{ await Foo.Bar(1, 2) }
Advanced Asynchronous Statement Nested: @{ @await Foo(boolValue: false) }
Advanced Incomplete Asynchronous Statement: @await ("wrrronggg")
\ No newline at end of file