From: Manjula GHM Date: Fri, 18 Mar 2005 04:45:46 +0000 (-0000) Subject: Test cases for Type members and Like operator X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=3131a144e876cab31c8b248cd3a323d333b921b3;p=mono.git Test cases for Type members and Like operator svn path=/trunk/mcs/; revision=41973 --- diff --git a/mcs/mbas/Test/ChangeLog b/mcs/mbas/Test/ChangeLog index 28dc85c5bfa..aab075b76cb 100644 --- a/mcs/mbas/Test/ChangeLog +++ b/mcs/mbas/Test/ChangeLog @@ -1,3 +1,6 @@ +2005-03-18 Manjula GHM + Sudharsan V + * Test cases for Type members and Like operator 2005-02-09 Raja R Harinath * Makefile (SUBDIRS): Add 'rerrors'. diff --git a/mcs/mbas/Test/rerrors/LikeOperator2.vb b/mcs/mbas/Test/rerrors/LikeOperator2.vb new file mode 100755 index 00000000000..4b10e4a66bb --- /dev/null +++ b/mcs/mbas/Test/rerrors/LikeOperator2.vb @@ -0,0 +1,20 @@ +'Author: +' V. Sudharsan (vsudharsan@novell.com) +' +' (C) 2005 Novell, Inc. + +Option Compare text +Imports System +Imports Nunit.Framework + + _ +Public Class LikeOperator2 + _ + Public Sub TestForException () + dim a as boolean + a = "?" Like "[?" + If a <> True Then + Throw new System.Exception("#A1-LikeOperator:Failed") + End If + end sub +End class diff --git a/mcs/mbas/Test/rerrors/LikeOperator3.vb b/mcs/mbas/Test/rerrors/LikeOperator3.vb new file mode 100755 index 00000000000..21235c4806d --- /dev/null +++ b/mcs/mbas/Test/rerrors/LikeOperator3.vb @@ -0,0 +1,20 @@ +'Author: +' V. Sudharsan (vsudharsan@novell.com) +' +' (C) 2005 Novell, Inc. + +'Option Compare text +Imports System +Imports Nunit.Framework + + _ +Public Class LikeOperator2 + _ + Public Sub TestForException () + dim a as boolean + a = "f" Like "[Z-A]" + If a <> True Then + Throw new System.Exception("#A1-LikeOperator:Failed") + End If + end sub +End class diff --git a/mcs/mbas/Test/rerrors/Test/Variables1.vb b/mcs/mbas/Test/rerrors/Test/Variables1.vb new file mode 100755 index 00000000000..abac324ad56 --- /dev/null +++ b/mcs/mbas/Test/rerrors/Test/Variables1.vb @@ -0,0 +1,17 @@ +'Author: +' V. Sudharsan (vsudharsan@novell.com) +' +' (C) 2005 Novell, Inc. + +Imports System +Imports Nunit.Framework + +_ +Public Class VariablesI + _ + Readonly Shared Public i as integer = "Hello" + Public Sub TestForException() + if i <> 1 + End if + End Sub +End Class diff --git a/mcs/mbas/Test/rerrors/Test/Variables2.vb b/mcs/mbas/Test/rerrors/Test/Variables2.vb new file mode 100755 index 00000000000..82fb68cac38 --- /dev/null +++ b/mcs/mbas/Test/rerrors/Test/Variables2.vb @@ -0,0 +1,16 @@ +'Author: +' V. Sudharsan (vsudharsan@novell.com) +' +' (C) 2005 Novell, Inc. + +Imports System +Imports Nunit.Framework + +_ +Public Class Variables2 + _ + Public Sub TestForException() + dim a as string = "hello" + dim i(1,a) as A + End Sub +End Class diff --git a/mcs/mbas/Test/tests/AssignmentStatementsA.exe b/mcs/mbas/Test/tests/AssignmentStatementsA.exe new file mode 100755 index 00000000000..c95893fc319 Binary files /dev/null and b/mcs/mbas/Test/tests/AssignmentStatementsA.exe differ diff --git a/mcs/mbas/Test/tests/AssignmentStatementsB.exe b/mcs/mbas/Test/tests/AssignmentStatementsB.exe new file mode 100755 index 00000000000..266b4635ab6 Binary files /dev/null and b/mcs/mbas/Test/tests/AssignmentStatementsB.exe differ diff --git a/mcs/mbas/Test/tests/AssignmentStatementsC.vb.log b/mcs/mbas/Test/tests/AssignmentStatementsC.vb.log new file mode 100644 index 00000000000..38f955885dd --- /dev/null +++ b/mcs/mbas/Test/tests/AssignmentStatementsC.vb.log @@ -0,0 +1,12 @@ + +MONO_PATH="../../../class/lib/default:$MONO_PATH" mono ../../../mbas/mbas.exe -d:NET_1_1 -d:ONLY_1_1 -debug /libpath:../../../class/lib/default /imports:System AssignmentStatementsC.vb +MonoBASIC Compiler 0.95.0.0 - (c)2002, 2003, 2004, 2005 Rafael Teixeira +-------- +THIS IS AN ALPHA SOFTWARE. +-------- +Internal warning BC-0018: Cannot find any symbol writer +AssignmentStatementsC.vb(18,15) error BC30455: Could not find any applicable function to invoke for this argument list +AssignmentStatementsC.vb(28,15) error BC30455: Could not find any applicable function to invoke for this argument list +AssignmentStatementsC.vb(33,15) error BC30455: Could not find any applicable function to invoke for this argument list +AssignmentStatementsC.vb(38,17) error BC30455: Could not find any applicable function to invoke for this argument list +Compilation failed: 4 Error(s), 1 warnings diff --git a/mcs/mbas/Test/tests/AssignmentStatementsD.exe b/mcs/mbas/Test/tests/AssignmentStatementsD.exe new file mode 100755 index 00000000000..295c675519d Binary files /dev/null and b/mcs/mbas/Test/tests/AssignmentStatementsD.exe differ diff --git a/mcs/mbas/Test/tests/AssignmentStatementsE.exe b/mcs/mbas/Test/tests/AssignmentStatementsE.exe new file mode 100755 index 00000000000..67cf8edae31 Binary files /dev/null and b/mcs/mbas/Test/tests/AssignmentStatementsE.exe differ diff --git a/mcs/mbas/Test/tests/AssignmentStatementsF.exe b/mcs/mbas/Test/tests/AssignmentStatementsF.exe new file mode 100755 index 00000000000..52fe96d5265 Binary files /dev/null and b/mcs/mbas/Test/tests/AssignmentStatementsF.exe differ diff --git a/mcs/mbas/Test/tests/AssignmentStatementsG.exe b/mcs/mbas/Test/tests/AssignmentStatementsG.exe new file mode 100755 index 00000000000..60e9121034d Binary files /dev/null and b/mcs/mbas/Test/tests/AssignmentStatementsG.exe differ diff --git a/mcs/mbas/Test/tests/AssignmentStatementsH.exe b/mcs/mbas/Test/tests/AssignmentStatementsH.exe new file mode 100755 index 00000000000..1d7b5c1a05b Binary files /dev/null and b/mcs/mbas/Test/tests/AssignmentStatementsH.exe differ diff --git a/mcs/mbas/Test/tests/AssignmentStatementsI.exe b/mcs/mbas/Test/tests/AssignmentStatementsI.exe new file mode 100755 index 00000000000..40e2b37f714 Binary files /dev/null and b/mcs/mbas/Test/tests/AssignmentStatementsI.exe differ diff --git a/mcs/mbas/Test/tests/BlockStatementsA.vb.log b/mcs/mbas/Test/tests/BlockStatementsA.vb.log new file mode 100644 index 00000000000..745c5faae21 --- /dev/null +++ b/mcs/mbas/Test/tests/BlockStatementsA.vb.log @@ -0,0 +1,8 @@ + +MONO_PATH="../../../class/lib/default:$MONO_PATH" mono ../../../mbas/mbas.exe -d:NET_1_1 -d:ONLY_1_1 -debug /libpath:../../../class/lib/default /imports:System BlockStatementsA.vb +MonoBASIC Compiler 0.95.0.0 - (c)2002, 2003, 2004, 2005 Rafael Teixeira +-------- +THIS IS AN ALPHA SOFTWARE. +-------- +BlockStatementsA.vb(34,0) error BC0140: The label 'f1' is a duplicate +Compilation failed: 1 Error(s), 0 warnings diff --git a/mcs/mbas/Test/tests/ConditionalStatementsA.exe b/mcs/mbas/Test/tests/ConditionalStatementsA.exe new file mode 100755 index 00000000000..89cf7f0ab2e Binary files /dev/null and b/mcs/mbas/Test/tests/ConditionalStatementsA.exe differ diff --git a/mcs/mbas/Test/tests/ConditionalStatementsB.exe b/mcs/mbas/Test/tests/ConditionalStatementsB.exe new file mode 100755 index 00000000000..a7bef37fcdb Binary files /dev/null and b/mcs/mbas/Test/tests/ConditionalStatementsB.exe differ diff --git a/mcs/mbas/Test/tests/ConditionalStatementsC.vb.log b/mcs/mbas/Test/tests/ConditionalStatementsC.vb.log new file mode 100644 index 00000000000..25cca95a598 --- /dev/null +++ b/mcs/mbas/Test/tests/ConditionalStatementsC.vb.log @@ -0,0 +1,9 @@ + +MONO_PATH="../../../class/lib/default:$MONO_PATH" mono ../../../mbas/mbas.exe -d:NET_1_1 -d:ONLY_1_1 -debug /libpath:../../../class/lib/default /imports:System ConditionalStatementsC.vb +MonoBASIC Compiler 0.95.0.0 - (c)2002, 2003, 2004, 2005 Rafael Teixeira +-------- +THIS IS AN ALPHA SOFTWARE. +-------- +syntax error, got token `OP_GE' +ConditionalStatementsC.vb(26,28) error BC29999: Parsing error +Compilation failed: 1 Error(s), 0 warnings diff --git a/mcs/mbas/Test/tests/ConditionalStatementsD.vb.log b/mcs/mbas/Test/tests/ConditionalStatementsD.vb.log new file mode 100644 index 00000000000..9db6aa12f5e --- /dev/null +++ b/mcs/mbas/Test/tests/ConditionalStatementsD.vb.log @@ -0,0 +1,8 @@ + +MONO_PATH="../../../class/lib/default:$MONO_PATH" mono ../../../mbas/mbas.exe -d:NET_1_1 -d:ONLY_1_1 -debug /libpath:../../../class/lib/default /imports:System ConditionalStatementsD.vb +MonoBASIC Compiler 0.95.0.0 - (c)2002, 2003, 2004, 2005 Rafael Teixeira +-------- +THIS IS AN ALPHA SOFTWARE. +-------- +ConditionalStatementsD.vb(16,0) error BC29999: Parsing error +Compilation failed: 1 Error(s), 0 warnings diff --git a/mcs/mbas/Test/tests/ConditionalStatementsE.exe b/mcs/mbas/Test/tests/ConditionalStatementsE.exe new file mode 100755 index 00000000000..f69be848d5d Binary files /dev/null and b/mcs/mbas/Test/tests/ConditionalStatementsE.exe differ diff --git a/mcs/mbas/Test/tests/ConditionalStatementsF.exe b/mcs/mbas/Test/tests/ConditionalStatementsF.exe new file mode 100755 index 00000000000..cf435d57fb4 Binary files /dev/null and b/mcs/mbas/Test/tests/ConditionalStatementsF.exe differ diff --git a/mcs/mbas/Test/tests/ConditionalStatementsG.exe b/mcs/mbas/Test/tests/ConditionalStatementsG.exe new file mode 100755 index 00000000000..976bf007e94 Binary files /dev/null and b/mcs/mbas/Test/tests/ConditionalStatementsG.exe differ diff --git a/mcs/mbas/Test/tests/ConditionalStatementsH.exe b/mcs/mbas/Test/tests/ConditionalStatementsH.exe new file mode 100755 index 00000000000..7b9a1dc1a22 Binary files /dev/null and b/mcs/mbas/Test/tests/ConditionalStatementsH.exe differ diff --git a/mcs/mbas/Test/tests/ConditionalStatementsI.exe b/mcs/mbas/Test/tests/ConditionalStatementsI.exe new file mode 100755 index 00000000000..719a1750924 Binary files /dev/null and b/mcs/mbas/Test/tests/ConditionalStatementsI.exe differ diff --git a/mcs/mbas/Test/tests/ConditionalStatementsJ.exe b/mcs/mbas/Test/tests/ConditionalStatementsJ.exe new file mode 100755 index 00000000000..824f92f96d7 Binary files /dev/null and b/mcs/mbas/Test/tests/ConditionalStatementsJ.exe differ diff --git a/mcs/mbas/Test/tests/ConstantC.vb b/mcs/mbas/Test/tests/ConstantC.vb new file mode 100755 index 00000000000..60fb1560414 --- /dev/null +++ b/mcs/mbas/Test/tests/ConstantC.vb @@ -0,0 +1,19 @@ +'Author: +' V. Sudharsan (vsudharsan@novell.com) +' +' (C) 2005 Novell, Inc. + +'Checking on all possible acessors on const +Imports System + +Module Test + Const a as Integer = 1 + Public Const a1 as Integer = 1 + Private Const a2 as Integer = 1 + Class C + Protected Const a3 as Integer = 1 + End Class + Public Sub Main() + End Sub +End Module + diff --git a/mcs/mbas/Test/tests/ConstructorD.vb b/mcs/mbas/Test/tests/ConstructorD.vb new file mode 100755 index 00000000000..0eb4da086b1 --- /dev/null +++ b/mcs/mbas/Test/tests/ConstructorD.vb @@ -0,0 +1,26 @@ +'Author: +' V. Sudharsan (vsudharsan@novell.com) +' +' (C) 2005 Novell, Inc. + +'To Prove Constructors can be overloaded + +Imports System + +Class A + Sub New() + End Sub + Sub New(I as Integer) + End Sub + Sub New(I as Integer, J as Integer) + End Sub + Shared Sub New() + End Sub +End Class + +Module Test + Public Sub Main() + Dim a as A = New A(10) + End Sub +End Module + diff --git a/mcs/mbas/Test/tests/ConstructorE.vb b/mcs/mbas/Test/tests/ConstructorE.vb new file mode 100755 index 00000000000..8c2e8ab4a0f --- /dev/null +++ b/mcs/mbas/Test/tests/ConstructorE.vb @@ -0,0 +1,23 @@ +'Author: +' V. Sudharsan (vsudharsan@novell.com) +' +' (C) 2005 Novell, Inc. + +Imports System + +Structure A + Dim i as Integer + Sub New(I as Integer) + End Sub + Sub New(I as Integer, J as Integer) + End Sub + Shared Sub New() + End Sub +End Structure + +Module Test + Public Sub Main() + Dim a as A = New A(10) + End Sub +End Module + diff --git a/mcs/mbas/Test/tests/ConstructorF.vb b/mcs/mbas/Test/tests/ConstructorF.vb new file mode 100755 index 00000000000..88639f66989 --- /dev/null +++ b/mcs/mbas/Test/tests/ConstructorF.vb @@ -0,0 +1,29 @@ +'Author: +' V. Sudharsan (vsudharsan@novell.com) +' +' (C) 2005 Novell, Inc. + +Imports System + +Class A + Public i as Integer = 10 + Sub New() + End Sub +End Class + +Class AB + Inherits A + Public i1 as Integer = MyBase.i + Sub New() + if i1<>10 then + Throw new System.Exception("Constructor not working properly") + End if + End Sub +End Class + +Module Test + Public Sub Main() + Dim a as AB= New AB() + End Sub +End Module + diff --git a/mcs/mbas/Test/tests/ConstructorG.vb b/mcs/mbas/Test/tests/ConstructorG.vb new file mode 100755 index 00000000000..70946f0618e --- /dev/null +++ b/mcs/mbas/Test/tests/ConstructorG.vb @@ -0,0 +1,32 @@ +'Author: +' V. Sudharsan (vsudharsan@novell.com) +' +' (C) 2005 Novell, Inc. + +'To check if initializing takes place according to the occurance + +Imports System + +Class A + Public i as Integer = j + Public j as Integer = 1 + Sub New() + if i<>0 + Throw new System.Exception("Constructor not working properly") + End if + End Sub +End Class + +Class AB + Inherits A + Public k as Integer = i + Sub New() + End Sub +End Class + +Module Test + Public Sub Main() + Dim a as AB = New AB() + End Sub +End Module + diff --git a/mcs/mbas/Test/tests/ConstructorH.vb b/mcs/mbas/Test/tests/ConstructorH.vb new file mode 100755 index 00000000000..63882331879 --- /dev/null +++ b/mcs/mbas/Test/tests/ConstructorH.vb @@ -0,0 +1,23 @@ +'Author: +' V. Sudharsan (vsudharsan@novell.com) +' +' (C) 2005 Novell, Inc. + +Imports System + +Class A + ' Has implicit Constructor defined +End Class + +Class AB + Inherits A + Sub New() + End Sub +End Class + +Module Test + Public Sub Main() + Dim a as AB = new AB() + End Sub +End Module + diff --git a/mcs/mbas/Test/tests/ConstructorI.vb b/mcs/mbas/Test/tests/ConstructorI.vb new file mode 100755 index 00000000000..deacb9dafb0 --- /dev/null +++ b/mcs/mbas/Test/tests/ConstructorI.vb @@ -0,0 +1,32 @@ +'Author: +' V. Sudharsan (vsudharsan@novell.com) +' +' (C) 2005 Novell, Inc. + +Imports System + +Imports A + +NameSpace A + Public Class B + Shared Public i as integer + End Class +End Namespace + +Class AB + Shared Sub New() + A.B.i = A.B.i + 1 + End Sub +End Class + +Module Test + Public Sub Main() + Dim a1 as AB = new AB() + Dim b2 as AB = new AB() + Dim c3 as AB = new AB() + if A.B.i<>1 + Throw new System.Exception("Shared Constructor not working") + End if + End Sub +End Module + diff --git a/mcs/mbas/Test/tests/ConstructorJ.vb b/mcs/mbas/Test/tests/ConstructorJ.vb new file mode 100755 index 00000000000..2ebb42c661e --- /dev/null +++ b/mcs/mbas/Test/tests/ConstructorJ.vb @@ -0,0 +1,29 @@ +'Author: +' V. Sudharsan (vsudharsan@novell.com) +' +' (C) 2005 Novell, Inc. + +'Checking circular references + +Imports System + +Class A + Public Shared X As Integer = B.Y + 1 + Shared Sub Hello() + if A.X <> 2 or B.Y <> 1 + Throw new System.Exception("Shared Construtor not working") + End if + End Sub +End Class + +Class B + Public Shared Y As Integer = A.X + 1 +End Class + + +Module Test + Public Sub Main() + A.Hello() + End Sub +End Module + diff --git a/mcs/mbas/Test/tests/EventM.vb b/mcs/mbas/Test/tests/EventM.vb new file mode 100755 index 00000000000..c649da5b013 --- /dev/null +++ b/mcs/mbas/Test/tests/EventM.vb @@ -0,0 +1,26 @@ +'Author: +' V. Sudharsan (vsudharsan@novell.com) +' +' (C) 2005 Novell, Inc. + +'To Check if Methods Accebility has anything to do with Events + +Imports System + +Class Raiser + Public Event Fun(ByVal i as Integer) + Public Sub New(i as Integer) + RaiseEvent Fun(23) + End Sub +End Class + +Module Test + Private WithEvents x As Raiser + + Private Sub Fun(ByVal i as integer) Handles x.Fun + End Sub + + Public Sub Main() + x = New Raiser(10) + End Sub +End Module diff --git a/mcs/mbas/Test/tests/EventN.vb b/mcs/mbas/Test/tests/EventN.vb new file mode 100755 index 00000000000..fe12ea641ea --- /dev/null +++ b/mcs/mbas/Test/tests/EventN.vb @@ -0,0 +1,31 @@ +'Author: +' V. Sudharsan (vsudharsan@novell.com) +' +' (C) 2005 Novell, Inc. + +'To Check if Multiple Methods can access mulitplte events + +Imports System + +Class Raiser + Public Event Fun(ByVal i as Integer) + Public Event Fun1(ByVal i as Integer) + Public Sub New(i as Integer) + RaiseEvent Fun(23) + End Sub +End Class + +Module Test + Private WithEvents x As Raiser + + Private Sub Fun(ByVal i as integer) Handles x.Fun, X.Fun1 + End Sub + + Public Sub Fun1(ByVal i as integer) Handles X.Fun1 + End Sub + + + Public Sub Main() + x = New Raiser(10) + End Sub +End Module diff --git a/mcs/mbas/Test/tests/ExitStatementA.exe b/mcs/mbas/Test/tests/ExitStatementA.exe new file mode 100755 index 00000000000..0bf48499928 Binary files /dev/null and b/mcs/mbas/Test/tests/ExitStatementA.exe differ diff --git a/mcs/mbas/Test/tests/ExitStatementA.vb.log b/mcs/mbas/Test/tests/ExitStatementA.vb.log new file mode 100644 index 00000000000..2d628e4be07 --- /dev/null +++ b/mcs/mbas/Test/tests/ExitStatementA.vb.log @@ -0,0 +1,16 @@ + +MONO_PATH="../../../class/lib/default:$MONO_PATH" mono ../../../mbas/mbas.exe -d:NET_1_1 -d:ONLY_1_1 -debug /libpath:../../../class/lib/default /imports:System ExitStatementA.vb +MonoBASIC Compiler 0.95.0.0 - (c)2002, 2003, 2004, 2005 Rafael Teixeira +-------- +THIS IS AN ALPHA SOFTWARE. +-------- +Internal warning BC-0018: Cannot find any symbol writer +ExitStatementA.vb(11,0) warning BC0162: Unreachable code detected +Compilation succeeded: 2 warning(s) + +MONO_PATH="../../../class/lib/default::$MONO_PATH" mono --debug ./ExitStatementA.exe + +** ERROR **: Invalid IL code at IL0000 in exitstmt:fun (): IL_0000: ret + + +aborting... diff --git a/mcs/mbas/Test/tests/GotoStatementA.vb.log b/mcs/mbas/Test/tests/GotoStatementA.vb.log new file mode 100644 index 00000000000..500ed2e25f3 --- /dev/null +++ b/mcs/mbas/Test/tests/GotoStatementA.vb.log @@ -0,0 +1,8 @@ + +MONO_PATH="../../../class/lib/default:$MONO_PATH" mono ../../../mbas/mbas.exe -d:NET_1_1 -d:ONLY_1_1 -debug /libpath:../../../class/lib/default /imports:System GotoStatementA.vb +MonoBASIC Compiler 0.95.0.0 - (c)2002, 2003, 2004, 2005 Rafael Teixeira +-------- +THIS IS AN ALPHA SOFTWARE. +-------- +GotoStatementA.vb(10,0) error BC29999: 'Nothing' found without a matching 'Block' +Compilation failed diff --git a/mcs/mbas/Test/tests/InterfaceQ.vb b/mcs/mbas/Test/tests/InterfaceQ.vb new file mode 100755 index 00000000000..cf231ddc5f0 --- /dev/null +++ b/mcs/mbas/Test/tests/InterfaceQ.vb @@ -0,0 +1,29 @@ +'Author: +' V. Sudharsan (vsudharsan@novell.com) +' +' (C) 2005 Novell, Inc. + +Module InterfaceA + Interface A + Sub fun() + Sub fun1() + Sub fun2() + Sub fun3() + End Interface + + Class B + Implements A + Public Sub AA1() Implements A.fun + End Sub + Private Sub AA2() Implements A.fun1 + End Sub + Protected Sub AA3() Implements A.fun2 + End Sub + Sub AA4() Implements A.fun3 + End Sub + End Class + + Sub Main() + End Sub +End Module + diff --git a/mcs/mbas/Test/tests/InvocationStatementA.exe b/mcs/mbas/Test/tests/InvocationStatementA.exe new file mode 100755 index 00000000000..72192bfdd98 Binary files /dev/null and b/mcs/mbas/Test/tests/InvocationStatementA.exe differ diff --git a/mcs/mbas/Test/tests/LikeOperatorB.vb b/mcs/mbas/Test/tests/LikeOperatorB.vb new file mode 100755 index 00000000000..40250d122f0 --- /dev/null +++ b/mcs/mbas/Test/tests/LikeOperatorB.vb @@ -0,0 +1,17 @@ +'Author: +' V. Sudharsan (vsudharsan@novell.com) +' +' (C) 2005 Novell, Inc. + +'Option Compare text +Imports System + +Module LikeOperator2 + Public Sub Main() + dim a as boolean + a = "o" Like "[A-Z]" + If a <> False Then + Throw new System.Exception("#A1-LikeOperator:Failed") + End If + end sub +End Module diff --git a/mcs/mbas/Test/tests/LikeOperatorC.vb b/mcs/mbas/Test/tests/LikeOperatorC.vb new file mode 100755 index 00000000000..29d91a4bbfb --- /dev/null +++ b/mcs/mbas/Test/tests/LikeOperatorC.vb @@ -0,0 +1,17 @@ +'Author: +' V. Sudharsan (vsudharsan@novell.com) +' +' (C) 2005 Novell, Inc. + +'Option Compare text +Imports System + +Module LikeOperator2 + Public Sub Main() + dim a as boolean + a = "" Like "[]" + If a <> True Then + Throw new System.Exception("#A1-LikeOperator:Failed") + End If + end sub +End Module diff --git a/mcs/mbas/Test/tests/LoopStatementsA.exe b/mcs/mbas/Test/tests/LoopStatementsA.exe new file mode 100755 index 00000000000..57f2b85fdac Binary files /dev/null and b/mcs/mbas/Test/tests/LoopStatementsA.exe differ diff --git a/mcs/mbas/Test/tests/LoopStatementsB.exe b/mcs/mbas/Test/tests/LoopStatementsB.exe new file mode 100755 index 00000000000..93e24c84671 Binary files /dev/null and b/mcs/mbas/Test/tests/LoopStatementsB.exe differ diff --git a/mcs/mbas/Test/tests/LoopStatementsC.exe b/mcs/mbas/Test/tests/LoopStatementsC.exe new file mode 100755 index 00000000000..94a320a1597 Binary files /dev/null and b/mcs/mbas/Test/tests/LoopStatementsC.exe differ diff --git a/mcs/mbas/Test/tests/LoopStatementsD.exe b/mcs/mbas/Test/tests/LoopStatementsD.exe new file mode 100755 index 00000000000..ba1095cf92d Binary files /dev/null and b/mcs/mbas/Test/tests/LoopStatementsD.exe differ diff --git a/mcs/mbas/Test/tests/LoopStatementsE.vb.log b/mcs/mbas/Test/tests/LoopStatementsE.vb.log new file mode 100644 index 00000000000..904028317ee --- /dev/null +++ b/mcs/mbas/Test/tests/LoopStatementsE.vb.log @@ -0,0 +1,30 @@ + +MONO_PATH="../../../class/lib/default:$MONO_PATH" mono ../../../mbas/mbas.exe -d:NET_1_1 -d:ONLY_1_1 -debug /libpath:../../../class/lib/default /imports:System LoopStatementsE.vb +MonoBASIC Compiler 0.95.0.0 - (c)2002, 2003, 2004, 2005 Rafael Teixeira +-------- +THIS IS AN ALPHA SOFTWARE. +-------- +Internal warning BC-0018: Cannot find any symbol writer +Exception: System.Exception: Expression Mono.MonoBASIC.Binary did not set its type after Resolve +called from: Mono.MonoBASIC.Binary +in <0x00548> Mono.MonoBASIC.Expression:Resolve (Mono.MonoBASIC.EmitContext ec, ResolveFlags flags) +in <0x00012> Mono.MonoBASIC.Expression:Resolve (Mono.MonoBASIC.EmitContext ec) +in <0x00131> Mono.MonoBASIC.Assign:DoResolve (Mono.MonoBASIC.EmitContext ec) +in <0x0016d> Mono.MonoBASIC.Expression:Resolve (Mono.MonoBASIC.EmitContext ec, ResolveFlags flags) +in <0x00012> Mono.MonoBASIC.Expression:Resolve (Mono.MonoBASIC.EmitContext ec) +in <0x0001d> Mono.MonoBASIC.StatementExpression:Resolve (Mono.MonoBASIC.EmitContext ec) +in <0x000eb> Mono.MonoBASIC.For:Resolve (Mono.MonoBASIC.EmitContext ec) +in <0x00167> Mono.MonoBASIC.Block:Resolve (Mono.MonoBASIC.EmitContext ec) +in <0x00167> Mono.MonoBASIC.Block:Resolve (Mono.MonoBASIC.EmitContext ec) +in <0x00167> Mono.MonoBASIC.Block:Resolve (Mono.MonoBASIC.EmitContext ec) +in <0x000cc> Mono.MonoBASIC.EmitContext:EmitTopBlock (Mono.MonoBASIC.Block block, System.String bname, Mono.MonoBASIC.InternalParameters ip, Location loc) +in <0x0044d> Mono.MonoBASIC.MethodData:Emit (Mono.MonoBASIC.TypeContainer parent, Mono.MonoBASIC.Block block, System.Object kind) +in <0x00031> Mono.MonoBASIC.Method:Emit (Mono.MonoBASIC.TypeContainer parent) +in <0x00253> Mono.MonoBASIC.TypeContainer:Emit () +in <0x0030d> Mono.MonoBASIC.RootContext:EmitCode () +in <0x0003f> Mono.Languages.Driver:GenerateAssembly () +in <0x0004b> Mono.Languages.Driver:CompileAll () +Compilation succeeded: 1 warning(s) + +MONO_PATH="../../../class/lib/default::$MONO_PATH" mono --debug ./LoopStatementsE.exe +cannot open assembly ./LoopStatementsE.exe diff --git a/mcs/mbas/Test/tests/LoopStatementsF.exe b/mcs/mbas/Test/tests/LoopStatementsF.exe new file mode 100755 index 00000000000..f946ece88a6 Binary files /dev/null and b/mcs/mbas/Test/tests/LoopStatementsF.exe differ diff --git a/mcs/mbas/Test/tests/LoopStatementsG.exe b/mcs/mbas/Test/tests/LoopStatementsG.exe new file mode 100755 index 00000000000..bd004d84012 Binary files /dev/null and b/mcs/mbas/Test/tests/LoopStatementsG.exe differ diff --git a/mcs/mbas/Test/tests/LoopStatementsG.vb.log b/mcs/mbas/Test/tests/LoopStatementsG.vb.log new file mode 100644 index 00000000000..9d6e4a0fa80 --- /dev/null +++ b/mcs/mbas/Test/tests/LoopStatementsG.vb.log @@ -0,0 +1,13 @@ + +MONO_PATH="../../../class/lib/default:$MONO_PATH" mono ../../../mbas/mbas.exe -d:NET_1_1 -d:ONLY_1_1 -debug /libpath:../../../class/lib/default /imports:System LoopStatementsG.vb +MonoBASIC Compiler 0.95.0.0 - (c)2002, 2003, 2004, 2005 Rafael Teixeira +-------- +THIS IS AN ALPHA SOFTWARE. +-------- +Internal warning BC-0018: Cannot find any symbol writer +Compilation succeeded: 1 warning(s) + +MONO_PATH="../../../class/lib/default::$MONO_PATH" mono --debug ./LoopStatementsG.exe + +Unhandled Exception: System.Exception: For loop not working. Expected -1 but got 9 +in <0x000d5> Test:Main () diff --git a/mcs/mbas/Test/tests/MethodDeclarationA.vb b/mcs/mbas/Test/tests/MethodDeclarationA.vb new file mode 100755 index 00000000000..363011147fe --- /dev/null +++ b/mcs/mbas/Test/tests/MethodDeclarationA.vb @@ -0,0 +1,16 @@ +'Author: +' V. Sudharsan (vsudharsan@novell.com) +' +' (C) 2005 Novell, Inc. + +'To check if a variable without any type is been accepted or not + +Imports System + +Module MethodDeclarationA + Sub A(i) + End Sub + Sub Main() + End Sub +End Module + diff --git a/mcs/mbas/Test/tests/MethodDeclarationB.vb b/mcs/mbas/Test/tests/MethodDeclarationB.vb new file mode 100755 index 00000000000..4770dda3912 --- /dev/null +++ b/mcs/mbas/Test/tests/MethodDeclarationB.vb @@ -0,0 +1,19 @@ +'Author: +' V. Sudharsan (vsudharsan@novell.com) +' +' (C) 2005 Novell, Inc. + +Imports System + +Module MethodDeclarationA + Function A(ByRef i as Integer)As Integer + i = 10 + End Function + Function AB()As Integer + return 10 + End Function + Sub Main() + A(AB()) + End Sub +End Module + diff --git a/mcs/mbas/Test/tests/MethodDeclarationC.vb b/mcs/mbas/Test/tests/MethodDeclarationC.vb new file mode 100755 index 00000000000..33190ffa801 --- /dev/null +++ b/mcs/mbas/Test/tests/MethodDeclarationC.vb @@ -0,0 +1,20 @@ +'Author: +' V. Sudharsan (vsudharsan@novell.com) +' +' (C) 2005 Novell, Inc. + +Imports System + +Module MethodDeclarationA + Function A(ByRef i as Integer)As Integer + i = 19 + End Function + Sub Main() + Dim i as String + A(i) + if i<>"19" then + Throw new System.Exception("ByRef not working") + End if + End Sub +End Module + diff --git a/mcs/mbas/Test/tests/MethodDeclarationD.vb b/mcs/mbas/Test/tests/MethodDeclarationD.vb new file mode 100755 index 00000000000..d01a14fc296 --- /dev/null +++ b/mcs/mbas/Test/tests/MethodDeclarationD.vb @@ -0,0 +1,16 @@ +'Author: +' V. Sudharsan (vsudharsan@novell.com) +' +' (C) 2005 Novell, Inc. + +Imports System + +Module MethodDeclarationA + Function A(ByRef i as Integer)As Integer + i = 19 + End Function + Sub Main() + A(10) + End Sub +End Module + diff --git a/mcs/mbas/Test/tests/MethodDeclarationE.vb b/mcs/mbas/Test/tests/MethodDeclarationE.vb new file mode 100755 index 00000000000..3cdc884b91f --- /dev/null +++ b/mcs/mbas/Test/tests/MethodDeclarationE.vb @@ -0,0 +1,16 @@ +'Author: +' V. Sudharsan (vsudharsan@novell.com) +' +' (C) 2005 Novell, Inc. + +'To Check if only those parameters that follow Optional must be Optional + +Imports System + +Module MethodDeclarationA + Sub A1(ByVal i as Integer, Optional ByVal j as Integer =10) + End Sub + Sub Main() + End Sub +End Module + diff --git a/mcs/mbas/Test/tests/MethodDeclarationF.vb b/mcs/mbas/Test/tests/MethodDeclarationF.vb new file mode 100755 index 00000000000..7e6e1764d20 --- /dev/null +++ b/mcs/mbas/Test/tests/MethodDeclarationF.vb @@ -0,0 +1,19 @@ +'Author: +' V. Sudharsan (vsudharsan@novell.com) +' +' (C) 2005 Novell, Inc. + +Imports System + +Module MethodDeclarationA + Sub A1 ( ByVal ParamArray j() as Date ) + Dim i as Date + For each i in j + Next i + End Sub + Sub Main() + Dim ar as Date() = {} + A1(ar) + End Sub +End Module + diff --git a/mcs/mbas/Test/tests/PropertyE.vb b/mcs/mbas/Test/tests/PropertyE.vb new file mode 100755 index 00000000000..c83015c01aa --- /dev/null +++ b/mcs/mbas/Test/tests/PropertyE.vb @@ -0,0 +1,22 @@ +'Author: +' V. Sudharsan (vsudharsan@novell.com) +' +' (C) 2005 Novell, Inc. + +option Explicit on +Imports System + +Class AB + Public writeonly Property Prop(a as Integer) as Integer + set + value = 0 + End set + End Property +End Class + +Module Test + Public Sub Main() + End Sub +End Module + + diff --git a/mcs/mbas/Test/tests/ReturnStatementA.exe b/mcs/mbas/Test/tests/ReturnStatementA.exe new file mode 100755 index 00000000000..166837a3454 Binary files /dev/null and b/mcs/mbas/Test/tests/ReturnStatementA.exe differ diff --git a/mcs/mbas/Test/tests/StopStatementA.exe b/mcs/mbas/Test/tests/StopStatementA.exe new file mode 100755 index 00000000000..6ce5be2e375 Binary files /dev/null and b/mcs/mbas/Test/tests/StopStatementA.exe differ diff --git a/mcs/mbas/Test/tests/StopStatementA.vb.log b/mcs/mbas/Test/tests/StopStatementA.vb.log new file mode 100644 index 00000000000..4d819382359 --- /dev/null +++ b/mcs/mbas/Test/tests/StopStatementA.vb.log @@ -0,0 +1,10 @@ + +MONO_PATH="../../../class/lib/default:$MONO_PATH" mono ../../../mbas/mbas.exe -d:NET_1_1 -d:ONLY_1_1 -debug /libpath:../../../class/lib/default /imports:System StopStatementA.vb +MonoBASIC Compiler 0.95.0.0 - (c)2002, 2003, 2004, 2005 Rafael Teixeira +-------- +THIS IS AN ALPHA SOFTWARE. +-------- +syntax error, got token `IDENTIFIER' +StopStatementA.vb(8,20) error BC29999: Unrecognized Pre-Processor statement +StopStatementA.vb(9,17) error BC29999: Parsing error +Compilation failed: 2 Error(s), 0 warnings diff --git a/mcs/mbas/Test/tests/TestResults.log b/mcs/mbas/Test/tests/TestResults.log new file mode 100644 index 00000000000..83f093b0d3f --- /dev/null +++ b/mcs/mbas/Test/tests/TestResults.log @@ -0,0 +1,70 @@ +======================== +AssignmentStatementsA.vb: OK +======================== +AssignmentStatementsB.vb: OK +======================== +AssignmentStatementsC.vb: FAILED COMPILATION +======================== +AssignmentStatementsD.vb: OK +======================== +AssignmentStatementsE.vb: OK +======================== +AssignmentStatementsF.vb: OK +======================== +AssignmentStatementsG.vb: OK +======================== +AssignmentStatementsH.vb: OK +======================== +AssignmentStatementsI.vb: OK +======================== +BlockStatementsA.vb: FAILED COMPILATION +======================== +ConditionalStatementsA.vb: OK +======================== +ConditionalStatementsB.vb: OK +======================== +ConditionalStatementsC.vb: FAILED COMPILATION +======================== +ConditionalStatementsD.vb: FAILED COMPILATION +======================== +ConditionalStatementsE.vb: OK +======================== +ConditionalStatementsF.vb: OK +======================== +ConditionalStatementsG.vb: OK +======================== +ConditionalStatementsH.vb: OK +======================== +ConditionalStatementsI.vb: OK +======================== +ConditionalStatementsJ.vb: OK +======================== +ExitStatementA.vb: FAILED EXECUTION +======================== +GotoStatementA.vb: FAILED COMPILATION +======================== +InvocationStatementA.vb: OK +======================== +LoopStatementsA.vb: OK +======================== +LoopStatementsB.vb: OK +======================== +LoopStatementsC.vb: OK +======================== +LoopStatementsD.vb: OK +======================== +LoopStatementsE.vb: FAILED EXECUTION +======================== +LoopStatementsF.vb: OK +======================== +LoopStatementsG.vb: FAILED EXECUTION +======================== +ReturnStatementA.vb: OK +======================== +StopStatementA.vb: FAILED COMPILATION +======================== +WithStatementA.vb: OK +======================== +WithStatementB.vb: FAILED EXECUTION +======================== +WithStatementC.vb: FAILED COMPILATION diff --git a/mcs/mbas/Test/tests/VariablesH.vb b/mcs/mbas/Test/tests/VariablesH.vb new file mode 100755 index 00000000000..8b5eeef9253 --- /dev/null +++ b/mcs/mbas/Test/tests/VariablesH.vb @@ -0,0 +1,20 @@ +'Author: +' V. Sudharsan (vsudharsan@novell.com) +' +' (C) 2005 Novell, Inc. + +Module M +Class A + Shared public i as Integer +End Class + Sub Main() + A.i = A.i+1 + fun() + End Sub + Sub fun() + A.i = A.i+1 + if A.i<>2 + Throw new System.Exception("Shared variable not workin") + end if + End Sub +End Module diff --git a/mcs/mbas/Test/tests/VariablesI.vb b/mcs/mbas/Test/tests/VariablesI.vb new file mode 100755 index 00000000000..77d8d0b5850 --- /dev/null +++ b/mcs/mbas/Test/tests/VariablesI.vb @@ -0,0 +1,47 @@ +'Author: +' V. Sudharsan (vsudharsan@novell.com) +' +' (C) 2005 Novell, Inc. + +Imports System + +Class Raiser + Public Event Constructed() + Public Sub New() + RaiseEvent Constructed + End Sub +End Class + + +Module Test + Private _x As Raiser + + Public Property x() As Raiser + Get + Return _x + End Get + + Set (ByVal Value As Raiser) + ' Unhook any existing handlers. + If Not _x Is Nothing Then + RemoveHandler _x.Constructed, AddressOf HandleConstructed + End If + + ' Change value. + _x = Value + + ' Hook-up new handlers. + If Not _x Is Nothing Then + AddHandler _x.Constructed, AddressOf HandleConstructed + End If + End Set + End Property + + Sub HandleConstructed() + Console.WriteLine("Constructed") + End Sub + + Sub Main() + x = New Raiser() + End Sub +End Module diff --git a/mcs/mbas/Test/tests/VariablesJ.vb b/mcs/mbas/Test/tests/VariablesJ.vb new file mode 100755 index 00000000000..173c29d2edd --- /dev/null +++ b/mcs/mbas/Test/tests/VariablesJ.vb @@ -0,0 +1,17 @@ +'Author: +' V. Sudharsan (vsudharsan@novell.com) +' +' (C) 2005 Novell, Inc. + +Imports System + +Module Test + Structure AB + Public Const i as Integer = 10 + Public j as integer + End Structure + + Public Sub Main() + End Sub +End Module + diff --git a/mcs/mbas/Test/tests/VariablesK.vb b/mcs/mbas/Test/tests/VariablesK.vb new file mode 100755 index 00000000000..b7cdbf3b0b4 --- /dev/null +++ b/mcs/mbas/Test/tests/VariablesK.vb @@ -0,0 +1,26 @@ +'Author: +' V. Sudharsan (vsudharsan@novell.com) +' +' (C) 2005 Novell, Inc. + +Imports System + +Class A + Public i as Integer + Sub New() + i = 20 + End Sub + Sub New (a as A) + i = a.i + End Sub +End Class + +Module Test + Public Sub Main() + dim a as A = new A() + dim j as A = new A(a) + if j.i<>20 + Throw new System.Exception("Initializer not working") + End if + End Sub +End Module diff --git a/mcs/mbas/Test/tests/VariablesL.vb b/mcs/mbas/Test/tests/VariablesL.vb new file mode 100755 index 00000000000..ebc3746e40c --- /dev/null +++ b/mcs/mbas/Test/tests/VariablesL.vb @@ -0,0 +1,16 @@ +'Author: +' V. Sudharsan (vsudharsan@novell.com) +' +' (C) 2005 Novell, Inc. + +Module Test + Sub Main() + dim b(4, 1) As Integer + + b(0, 0) = 0: b(0, 1) = 1 + b(1, 0) = 2: b(1, 1) = 3 + b(2, 0) = 4: b(2, 1) = 5 + b(3, 0) = 6: b(3, 1) = 7 + b(4, 0) = 8: b(4, 1) = 9 + End Sub +End Module diff --git a/mcs/mbas/Test/tests/VariablesM.vb b/mcs/mbas/Test/tests/VariablesM.vb new file mode 100755 index 00000000000..9df62647616 --- /dev/null +++ b/mcs/mbas/Test/tests/VariablesM.vb @@ -0,0 +1,27 @@ +'Author: +' V. Sudharsan (vsudharsan@novell.com) +' +' (C) 2005 Novell, Inc. + +Imports System + +Class AA + Inherits System.MarshalByRefObject + Public Function fun() + End Function +End Class + + +Class AAA + Public Function fun(a As AA) + End Function +End Class + +Module Test + Public Sub Main() + dim b as AA = new AA() + dim a as AAA = new AAA() + a.fun(b) + End Sub +End Module + diff --git a/mcs/mbas/Test/tests/WithStatementA.exe b/mcs/mbas/Test/tests/WithStatementA.exe new file mode 100755 index 00000000000..80281becfca Binary files /dev/null and b/mcs/mbas/Test/tests/WithStatementA.exe differ diff --git a/mcs/mbas/Test/tests/WithStatementB.exe b/mcs/mbas/Test/tests/WithStatementB.exe new file mode 100755 index 00000000000..30260427b4d Binary files /dev/null and b/mcs/mbas/Test/tests/WithStatementB.exe differ diff --git a/mcs/mbas/Test/tests/WithStatementB.vb.log b/mcs/mbas/Test/tests/WithStatementB.vb.log new file mode 100644 index 00000000000..88ad7d333f0 --- /dev/null +++ b/mcs/mbas/Test/tests/WithStatementB.vb.log @@ -0,0 +1,13 @@ + +MONO_PATH="../../../class/lib/default:$MONO_PATH" mono ../../../mbas/mbas.exe -d:NET_1_1 -d:ONLY_1_1 -debug /libpath:../../../class/lib/default /imports:System WithStatementB.vb +MonoBASIC Compiler 0.95.0.0 - (c)2002, 2003, 2004, 2005 Rafael Teixeira +-------- +THIS IS AN ALPHA SOFTWARE. +-------- +Internal warning BC-0018: Cannot find any symbol writer +Compilation succeeded: 1 warning(s) + +MONO_PATH="../../../class/lib/default::$MONO_PATH" mono --debug ./WithStatementB.exe + +Unhandled Exception: System.Exception: #WS1 - With Statement failed +in <0x000c0> WithStatementB:main () diff --git a/mcs/mbas/Test/tests/WithStatementC.vb.log b/mcs/mbas/Test/tests/WithStatementC.vb.log new file mode 100644 index 00000000000..03c5327c102 --- /dev/null +++ b/mcs/mbas/Test/tests/WithStatementC.vb.log @@ -0,0 +1,9 @@ + +MONO_PATH="../../../class/lib/default:$MONO_PATH" mono ../../../mbas/mbas.exe -d:NET_1_1 -d:ONLY_1_1 -debug /libpath:../../../class/lib/default /imports:System WithStatementC.vb +MonoBASIC Compiler 0.95.0.0 - (c)2002, 2003, 2004, 2005 Rafael Teixeira +-------- +THIS IS AN ALPHA SOFTWARE. +-------- +Internal warning BC-0018: Cannot find any symbol writer +WithStatementC.vb(16,21) error BC30132: No such label `labelA' in this scope +Compilation failed: 1 Error(s), 1 warnings diff --git a/mcs/mbas/Test/tests/test.vb b/mcs/mbas/Test/tests/test.vb new file mode 100644 index 00000000000..970d228d5dd --- /dev/null +++ b/mcs/mbas/Test/tests/test.vb @@ -0,0 +1,17 @@ +'Author: +' V. Sudharsan (vsudharsan@novell.com) +' +' (C) 2005 Novell, Inc. + +Module Test + Sub Main() + Dim i as integer + i = 20-10.5 + System.Console.WriteLine(20-10.5) + System.Console.WriteLine("i is {0}",i) +' if i<>15 then +' Throw New System.Exception("Select not working properly. Expected 15 but got "&i) +' End if + End Sub +End Module + diff --git a/mcs/mbas/Test/tests/test1.vb b/mcs/mbas/Test/tests/test1.vb new file mode 100644 index 00000000000..4cd2f71eea6 --- /dev/null +++ b/mcs/mbas/Test/tests/test1.vb @@ -0,0 +1,24 @@ +Imports System + +Module ConditionalStatementsC + + Sub Main() + + Dim i As Integer + Dim arr(10) As Integer + + For i = 0 To 10 + + Select Case i + Case 0 To 4 + 'Case 0 + 'arr(i) = 1 + Console.WriteLine("MANJU i is {0}",i) + End Select + + Next + + + End Sub + +End Module