Imported Upstream version 4.0.0~alpha1

Former-commit-id: 806294f5ded97629b74c85c09952f2a74fe182d9
This commit is contained in:
Jo Shields
2015-04-07 09:35:12 +01:00
parent 283343f570
commit 3c1f479b9d
22469 changed files with 2931443 additions and 869343 deletions

View File

@@ -86,7 +86,6 @@ namespace MonoTests.Microsoft.VisualBasic
sb.Length = 0;
Assert.AreEqual (typeof (void).FullName, Generate (new CodeTypeReferenceExpression (""), sw), "#14");
sb.Length = 0;
#if NET_2_0
Assert.AreEqual ("SByte", Generate (new CodeTypeReferenceExpression (typeof (sbyte)), sw), "#15");
sb.Length = 0;
Assert.AreEqual ("UShort", Generate (new CodeTypeReferenceExpression (typeof (ushort)), sw), "#16");
@@ -95,16 +94,6 @@ namespace MonoTests.Microsoft.VisualBasic
sb.Length = 0;
Assert.AreEqual ("ULong", Generate (new CodeTypeReferenceExpression (typeof (ulong)), sw), "#18");
sb.Length = 0;
#else
Assert.AreEqual (typeof (sbyte).FullName, Generate (new CodeTypeReferenceExpression (typeof (sbyte)), sw), "#19");
sb.Length = 0;
Assert.AreEqual (typeof(ushort).FullName, Generate (new CodeTypeReferenceExpression (typeof (ushort)), sw), "#20");
sb.Length = 0;
Assert.AreEqual (typeof(uint).FullName, Generate (new CodeTypeReferenceExpression (typeof (uint)), sw), "#21");
sb.Length = 0;
Assert.AreEqual (typeof(ulong).FullName, Generate (new CodeTypeReferenceExpression (typeof (ulong)), sw), "#22");
sb.Length = 0;
#endif
sw.Close ();
}
}
@@ -153,11 +142,7 @@ namespace MonoTests.Microsoft.VisualBasic
[Test]
public void PrimitiveExpressionTest_Char ()
{
#if NET_2_0
string vbNs = "Global.Microsoft.VisualBasic";
#else
string vbNs = "Microsoft.VisualBasic";
#endif
StringBuilder sb = new StringBuilder ();
using (StringWriter sw = new StringWriter (sb)) {
@@ -251,9 +236,6 @@ namespace MonoTests.Microsoft.VisualBasic
}
[Test]
#if ONLY_1_1
[ExpectedException (typeof (ArgumentException))]
#endif
public void PrimitiveExpressionTest_SByte ()
{
StringBuilder sb = new StringBuilder ();
@@ -265,9 +247,6 @@ namespace MonoTests.Microsoft.VisualBasic
}
[Test]
#if ONLY_1_1
[ExpectedException (typeof (ArgumentException))]
#endif
public void PrimitiveExpressionTest_UInt16 ()
{
StringBuilder sb = new StringBuilder ();
@@ -279,9 +258,6 @@ namespace MonoTests.Microsoft.VisualBasic
}
[Test]
#if ONLY_1_1
[ExpectedException (typeof (ArgumentException))]
#endif
public void PrimitiveExpressionTest_UInt32 ()
{
StringBuilder sb = new StringBuilder ();
@@ -293,9 +269,6 @@ namespace MonoTests.Microsoft.VisualBasic
}
[Test]
#if ONLY_1_1
[ExpectedException (typeof (ArgumentException))]
#endif
public void PrimitiveExpressionTest_UInt64 ()
{
StringBuilder sb = new StringBuilder ();
@@ -315,28 +288,16 @@ namespace MonoTests.Microsoft.VisualBasic
using (StringWriter sw = new StringWriter (sb)) {
cpde = new CodeParameterDeclarationExpression ();
#if NET_2_0
Assert.AreEqual ("ByVal __exception As System.Void", Generate (cpde, sw), "#1");
#else
Assert.AreEqual ("ByVal As System.Void", Generate (cpde, sw), "#1");
#endif
sb.Length = 0;
cpde = new CodeParameterDeclarationExpression ((string) null,
(string) null);
#if NET_2_0
Assert.AreEqual ("ByVal __exception As System.Void", Generate (cpde, sw), "#2");
#else
Assert.AreEqual ("ByVal As System.Void", Generate (cpde, sw), "#2");
#endif
sb.Length = 0;
cpde = new CodeParameterDeclarationExpression ("A", (string) null);
#if NET_2_0
Assert.AreEqual ("ByVal __exception As A", Generate (cpde, sw), "#3");
#else
Assert.AreEqual ("ByVal As A", Generate (cpde, sw), "#3");
#endif
sb.Length = 0;
cpde = new CodeParameterDeclarationExpression ((string) null, "B");
@@ -507,31 +468,19 @@ namespace MonoTests.Microsoft.VisualBasic
sb = new StringBuilder ();
using (StringWriter sw = new StringWriter (sb)) {
code = Generate (new CodeDelegateInvokeExpression (null, new CodePrimitiveExpression ("abc")), sw);
#if NET_2_0
Assert.AreEqual ("(\"abc\")", code, "#01");
#else
Assert.AreEqual ("RaiseEvent (\"abc\")", code, "#01");
#endif
}
sb = new StringBuilder ();
using (StringWriter sw = new StringWriter (sb)) {
code = Generate (new CodeDelegateInvokeExpression (new CodeThisReferenceExpression (), new CodePrimitiveExpression ("abc")), sw);
#if NET_2_0
Assert.AreEqual ("Me(\"abc\")", code, "#02");
#else
Assert.AreEqual ("RaiseEvent Me(\"abc\")", code, "#02");
#endif
}
sb = new StringBuilder ();
using (StringWriter sw = new StringWriter (sb)) {
code = Generate (new CodeDelegateInvokeExpression (new CodePrimitiveExpression ("primitive"), new CodePrimitiveExpression ("abc")), sw);
#if NET_2_0
Assert.AreEqual ("\"primitive\"(\"abc\")", code, "#03");
#else
Assert.AreEqual ("RaiseEvent \"primitive\"(\"abc\")", code, "#03");
#endif
}
sb = new StringBuilder ();

View File

@@ -161,7 +161,6 @@ namespace MonoTests.Microsoft.VisualBasic
"End Namespace{0}", NewLine), Generate (options), "#B2");
}
#if NET_2_0
[Test]
public void Type_TypeParameters ()
{
@@ -478,6 +477,5 @@ namespace MonoTests.Microsoft.VisualBasic
" End Class{0}" +
"End Namespace{0}", NewLine), Generate ());
}
#endif
}
}

View File

@@ -243,11 +243,7 @@ namespace MonoTests.Microsoft.VisualBasic
" ;{0}" +
" DoB(){0}" +
" {0}" +
#if NET_2_0
"A{0}" +
#else
" A{0}" +
#endif
" DoC(){0}" +
"End If{0}", NewLine), Generate (), "#3");
@@ -258,19 +254,11 @@ namespace MonoTests.Microsoft.VisualBasic
" ;{0}" +
" DoB(){0}" +
" {0}" +
#if NET_2_0
"A{0}" +
#else
" A{0}" +
#endif
" DoC(){0}" +
"Else{0}" +
" DoD(){0}" +
#if NET_2_0
"B{0}" +
#else
" B{0}" +
#endif
" ;{0}" +
" DoE(){0}" +
" {0}" +
@@ -285,19 +273,11 @@ namespace MonoTests.Microsoft.VisualBasic
" ;{0}" +
" DoB(){0}" +
" {0}" +
#if NET_2_0
"A{0}" +
#else
" A{0}" +
#endif
" DoC(){0}" +
"Else{0}" +
" DoD(){0}" +
#if NET_2_0
"B{0}" +
#else
" B{0}" +
#endif
" ;{0}" +
" DoE(){0}" +
" {0}" +
@@ -312,11 +292,7 @@ namespace MonoTests.Microsoft.VisualBasic
"If true == false Then{0}" +
"Else{0}" +
" DoD(){0}" +
#if NET_2_0
"B{0}" +
#else
" B{0}" +
#endif
" ;{0}" +
" DoE(){0}" +
" {0}" +
@@ -331,11 +307,7 @@ namespace MonoTests.Microsoft.VisualBasic
" ;{0}" +
" DoB(){0}" +
" {0}" +
#if NET_2_0
"A{0}" +
#else
" A{0}" +
#endif
" DoC(){0}" +
"End If{0}", NewLine), Generate (), "#7");
}
@@ -422,17 +394,9 @@ namespace MonoTests.Microsoft.VisualBasic
" ;{0}" +
" DoB(){0}" +
"test:{0}" +
#if NET_2_0
"C{0}" +
#else
" C{0}" +
#endif
" {0}" +
#if NET_2_0
"A{0}" +
#else
" A{0}" +
#endif
" DoC(){0}" +
" testInt = (testInt + 1){0}" +
"Loop{0}", NewLine), Generate (), "#5");
@@ -454,11 +418,7 @@ namespace MonoTests.Microsoft.VisualBasic
cls.Statement = new CodeSnippetStatement ("A");
Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
"class:{0}" +
#if NET_2_0
"A{0}",
#else
" A{0}",
#endif
NewLine), Generate (), "#3");
}
@@ -575,19 +535,10 @@ namespace MonoTests.Microsoft.VisualBasic
"Try {0}" +
" goto exit{0}" +
"Catch ex1 As System.ArgumentException{0}" +
#if NET_2_0
"Catch __exception As System.ApplicationException{0}" +
#else
"Catch As System.ApplicationException{0}" +
#endif
"Finally{0}" +
#if NET_2_0
"A{0}" +
"B{0}" +
#else
" A{0}" +
" B{0}" +
#endif
"End Try{0}", NewLine), Generate (), "#1");
options.ElseOnClosing = true;
@@ -595,19 +546,10 @@ namespace MonoTests.Microsoft.VisualBasic
"Try {0}" +
" goto exit{0}" +
"Catch ex1 As System.ArgumentException{0}" +
#if NET_2_0
"Catch __exception As System.ApplicationException{0}" +
#else
"Catch As System.ApplicationException{0}" +
#endif
"Finally{0}" +
#if NET_2_0
"A{0}" +
"B{0}" +
#else
" A{0}" +
" B{0}" +
#endif
"End Try{0}", NewLine), Generate (), "#2");
statement = new CodeTryCatchFinallyStatement ();
@@ -630,11 +572,7 @@ namespace MonoTests.Microsoft.VisualBasic
statement = cvds;
Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
#if NET_2_0
"Dim __exception As System.Void{0}",
#else
"Dim As System.Void{0}",
#endif
NewLine), Generate (), "#1");
cvds.Name = "class";
@@ -655,11 +593,7 @@ namespace MonoTests.Microsoft.VisualBasic
cvds.Name = null;
Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
#if NET_2_0
"Dim __exception As Integer = 25{0}",
#else
"Dim As Integer = 25{0}",
#endif
NewLine), Generate (), "#6");
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1 +0,0 @@
207bb9f47864178e6c88bf4d5a4dd313bed99f8e

View File

@@ -66,7 +66,6 @@ namespace MonoCasTests.Microsoft.VisualBasic {
catch (NotImplementedException) {
// mono
}
#if NET_2_0
CodeTypeMember ctm = new CodeTypeMember ();
StringWriter sw = new StringWriter ();
CodeGeneratorOptions cgo = new CodeGeneratorOptions ();
@@ -76,7 +75,6 @@ namespace MonoCasTests.Microsoft.VisualBasic {
catch (NotImplementedException) {
// mono
}
#endif
}
// LinkDemand

View File

@@ -109,13 +109,11 @@ namespace MonoTests.Microsoft.VisualBasic
Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.StaticConstructors), "#20");
Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.TryCatchStatements), "#21");
Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.Win32Resources), "#22");
#if NET_2_0
Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.DeclareIndexerProperties), "#23");
Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.GenericTypeDeclaration), "#24");
Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.GenericTypeReference), "#25");
Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.PartialTypes), "#26");
Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.Resources), "#27");
#endif
}
[Test]
@@ -211,9 +209,7 @@ namespace MonoTests.Microsoft.VisualBasic
options.GenerateExecutable = false;
options.GenerateInMemory = true;
options.TempFiles = new TempFileCollection (_tempDir);
#if NET_2_0
options.EmbeddedResources.Add (sourceFile);
#endif
ICodeCompiler compiler = _codeProvider.CreateCompiler ();
CompilerResults results = compiler.CompileAssemblyFromFile (options,
@@ -234,14 +230,12 @@ namespace MonoTests.Microsoft.VisualBasic
Assert.AreEqual (1, tempFiles.Length, "#5");
Assert.AreEqual (sourceFile, tempFiles[0], "#6");
#if NET_2_0
string[] resources = compiledAssembly.GetManifestResourceNames();
Assert.IsNotNull (resources, "#7");
Assert.AreEqual (1, resources.Length, "#8");
Assert.AreEqual ("file.vb", resources[0], "#9");
Assert.IsNull (compiledAssembly.GetFile ("file.vb"), "#10");
Assert.IsNotNull (compiledAssembly.GetManifestResourceStream ("file.vb"), "#11");
#endif
}
[Test]
@@ -272,10 +266,8 @@ namespace MonoTests.Microsoft.VisualBasic
options.GenerateInMemory = true;
options.OutputAssembly = string.Empty;
options.TempFiles = new TempFileCollection (_tempDir);
#if NET_2_0
options.EmbeddedResources.Add (sourceFile1);
options.LinkedResources.Add (sourceFile2);
#endif
ICodeCompiler compiler = _codeProvider.CreateCompiler ();
CompilerResults results = compiler.CompileAssemblyFromFileBatch (options,
@@ -303,7 +295,6 @@ namespace MonoTests.Microsoft.VisualBasic
Assert.IsTrue (File.Exists (sourceFile1), "#C2");
Assert.IsTrue (File.Exists (sourceFile2), "#C3");
#if NET_2_0
string[] resources = compiledAssembly.GetManifestResourceNames();
Assert.IsNotNull (resources, "#D1");
Assert.AreEqual (2, resources.Length, "#D2");
@@ -334,7 +325,6 @@ namespace MonoTests.Microsoft.VisualBasic
Assert.AreEqual ("file2.vb", info.FileName, "#F6");
Assert.IsNull (info.ReferencedAssembly, "#F7");
Assert.AreEqual ((ResourceLocation) 0, info.ResourceLocation, "#F8");
#endif
}
[Test]
@@ -364,10 +354,8 @@ namespace MonoTests.Microsoft.VisualBasic
options.GenerateExecutable = false;
options.GenerateInMemory = true;
options.TempFiles = new TempFileCollection (_tempDir);
#if NET_2_0
options.EmbeddedResources.Add (sourceFile1);
options.LinkedResources.Add (sourceFile2);
#endif
ICodeCompiler compiler = _codeProvider.CreateCompiler ();
CompilerResults results = compiler.CompileAssemblyFromFileBatch (options,
@@ -395,7 +383,6 @@ namespace MonoTests.Microsoft.VisualBasic
Assert.IsTrue (File.Exists (sourceFile1), "#C2");
Assert.IsTrue (File.Exists (sourceFile2), "#C3");
#if NET_2_0
string[] resources = compiledAssembly.GetManifestResourceNames();
Assert.IsNotNull (resources, "#D1");
Assert.AreEqual (2, resources.Length, "#D2");
@@ -426,7 +413,6 @@ namespace MonoTests.Microsoft.VisualBasic
Assert.AreEqual ("file2.vb", info.FileName, "#F6");
Assert.IsNull (info.ReferencedAssembly, "#F7");
Assert.AreEqual ((ResourceLocation) 0, info.ResourceLocation, "#F8");
#endif
}
[Test]