+++ /dev/null
-Imports System
-Namespace NS1
- Module M
- Dim a As Integer=20
- Sub Main()
- End Sub
- End Module
-End Namespace
-
+++ /dev/null
-Imports System
-Namespace NS1
- Namespace NNS1
- Module M
- Sub Main()
- End Sub
- End Module
-
- End Namespace
-End Namespace
-
+++ /dev/null
-Namespace NS1
- Module NamespaceTest
- Namespace NS2
- End Namespace
- Sub Main()
- End Sub
- End Module
-End Namespace
+++ /dev/null
-Namespace NS1
- Dim a As Integer
- Module NamespaceTest
- Sub Main()
- End Sub
- End Module
-End Namespace
+++ /dev/null
-Namespace NS1
- Module NameSpaceTest
- End Module
-End Namespace
-Namespace NS1
- Module NameSpaceTest
- Sub Main()
- End Sub
- End Module
-End Namespace
+++ /dev/null
-'Imports System
-Namespace NS1
- Module M
- Public a As Integer=20
- End Module
-End Namespace
-Namespace NS2
- Module M
- Dim a As Integer=30
- Sub Main()
- Dim a As Integer=40
- System.Console.WriteLine(a)
- Try
- If a<>40 Then
- Throw New System.Exception("#A1:Namespace:Failed")
- End If
- If NS1.M.a<>20 Then
- Throw New System.Exception("#A2:Namespace:Failed")
- End If
- If NS2.M.a<>30 Then
- Throw New System.Exception("#A3:Namespace:Failed")
- End If
- Catch e As Exception
- System.Console.WriteLine(e.Message)
- End Try
- End Sub
- End Module
-End Namespace
-
+++ /dev/null
-Imports System
-NotInheritable Class A
- Public MustOverride Sub F()
-End Class
-
-Module NotInheritableTest
- Sub Main()
- End Sub
-End Module
+++ /dev/null
-'Testing overloading in different classes
-Class B
- Public Function F()
- End Function
-
- Public Function F(ByVal i As Integer)
- End Function
-
- Public Function F(ByVal s As String)
- End Function
-
- Public overridable Function F1()
- End Function
-
- Public Function F1(ByVal i As Integer)
- End Function
-End Class
-
-Class D
- Inherits B
-
- Public Function F()
- End Function
-
- Public overloads Function F(ByVal s as Integer)
- End Function
-
- Public overloads Function F(ByVal s As String)
- End Function
-
- Public Function F1()
- End Function
-End Class
-
-Module OverloadingA
- Sub Main()
- Dim x As D = New D()
-
- x.F()
- x.F(10)
- x.F1(20)
-
- Dim x1 As B=New B()
- x1.F(20)
- x1.F1()
- End Sub
-
-End Module
+++ /dev/null
-Class C1
- Public Notoverridable Sub S() 'methods that do not override any other method should not be declared 'notoverridable'
-
- End Sub
-End Class
-Module OverrideC2
- Sub Main()
- End Sub
-End Module
+++ /dev/null
-Class C1
- Private Overridable Sub S() 'Overridable methods should not be private
- End Sub
- Shared Overridable Sub F() 'Overridable methods should not be shared
- End Sub
-End Class
-Module OverrideC2
- Sub Main()
- End Sub
-End Module
+++ /dev/null
-Class C1
- Public Overridable Sub S(byVal a As Integer)
- End Sub
-End Class
-Class C2
- Inherits C1
- Public Overrides Sub S()
- End Sub
- Private Overrides Sub S(byVal a As Integer)
- End Sub
- Public Overrides Sub S(byRef a As Integer)
- End Sub
- Public Overrides Sub S(byVal a As String)
- End Sub
-End Class
-Module OverrideC2
- Sub Main()
- End Sub
-End Module
+++ /dev/null
-Imports System\r
-Namespace N1\r
- Namespace N2\r
- Class C1\r
- Public Shared a As Integer\r
- Public Shared b As Integer\r
- Public Shared Function F() As Integer\r
- Try\r
- N1.N2.C1.a=20\r
- Catch e As Exception\r
- Console.WriteLine("error resolving a fully qualified name")\r
- End Try\r
- b=30\r
- Return 47\r
- End Function\r
- End Class\r
- End Namespace\r
-End Namespace\r
-Module QualifiedNames\r
- Sub Main()\r
- If N1.N2.C1.F()<>47 Then\r
- Throw New Exception("#A1:QualifiedNames:Failed-Error accessing function using fully qualified names")\r
- End If\r
- If N1.N2.C1.a<>20 Then\r
- Throw New Exception("#A2:QualifiedNames:Failed-Error accessing variables using fully qualified names")\r
- End If\r
- If N1.N2.C1.b<>30 Then\r
- Throw New Exception("#A3:QualifiedNames:Failed-Error accessing variables using fully qualified names")\r
- End If\r
- End Sub\r
-End Module\r
+++ /dev/null
-Imports System
-Module RegionDirectives
- #Region
- Sub Main()
-
- End Sub
- #End Region
-End Module
+++ /dev/null
-Imports System
-Module RegionDirectives
- Sub Main()
- #Region
-
- #End Region
- End Sub
-End Module
+++ /dev/null
-Imports System
-Module Scope1
- Public Function S() As Integer
- Return 1
- End Function
-End Module
-Module Scope
- Sub Main()
- Dim a As Integer=S()
- If a<>1 Then
- Throw New Exception("ScopeA:Failed-public method should be visible in other modules too")
- End If
- End Sub
-End Module
+++ /dev/null
-Class B
- Private Function F()
- End Function
-End Class
-
-Class D
- Inherits B
-
- Shadows Function F()
- End Function
-End Class
-\r
-Module ShadowsC3\r
- Sub Main()\r
- End Sub\r
-End Module\r
+++ /dev/null
-Imports System
-Module SingleLiteral
- Sub Main()
- Try
- Dim a As Single=1.23
- Dim b As Single=1.23E+10
- Catch e As Exception
- Console.WriteLine(e.Message)
- End Try
- End Sub
-End Module
+++ /dev/null
-Imports System
-Module SingleLiteral
- Sub Main()
- Try
- Dim a As Single=1.23E+40F
- Dim b As Single
- b="Hello"
- Catch e As Exception
- Console.WriteLine(e.Message)
- End Try
- End Sub
-End Module
+++ /dev/null
-Imports System
-Module SingleLiteral
- Sub Main()
- Try
- Dim a As Single=1.23F
- Dim b As Single=1.23E+10F
- Dim c As Single=9223372036854775808F
- Dim d As Single=.23F
- Dim f As Single
- If a<>1.23F Then
- Console.WriteLine("#A1-SingleLiteralA:Failed")
- End If
- If b<>1.23E+10F Then
- Console.WriteLine("#A2-SingleLiteralA:Failed")
- End If
- If c<>9.223372E+18F Then
- Console.WriteLine("#A3-SingleLiteralA:Failed")
- End If
- If d<>0.23 Then
- Console.WriteLine("#A4-SingleLiteralA:Failed")
- End If
- If f<>0 Then
- Console.WriteLine("#A5-SingleLiteralA:Failed")
- End If
-
-
- Catch e As Exception
- Console.WriteLine(e.Message)
- End Try
- End Sub
-End Module
+++ /dev/null
-Imports System
-Module SingleLiteral
- Sub Main()
- Try
- Dim a As Single=True
- If a<>-1 Then
- Console.WriteLine("SingleLiteralB:Failed")
- End If
-
-
- Catch e As Exception
- Console.WriteLine(e.Message)
- End Try
- End Sub
-End Module
+++ /dev/null
-Module M
- Sub Main()
- Dim a!
- a=10
-
- Dim b As Single
- b!=10
-
- Dim c!
- c!=10
- End Sub
-End Module
+++ /dev/null
-Module SingleTypeCharTest\r
- Sub Main()\r
- Try\r
- Dim m As Integer\r
- m = f(20)\r
- If m <> 20 Then\r
- Throw New Exception("IntegerTypeChar: failed")\r
- End If\r
- Exit Sub\r
- Catch e As Exception\r
- Console.WriteLine(e.Message)\r
- End Try\r
- End Sub\r
-\r
- Function f!(ByVal param!)\r
- f! = param\r
- End Function\r
-End Module\r
+++ /dev/null
-Module M
- Sub Main()
- Dim a 'Default type assigned is Object
- a!=10 'Single type character does not conform with assigned type Object
-
- Dim b As Single
- b!=10 'Long type character does not conform with assigned type Integer
-
- Dim c !
-
- End Sub
-End Module
+++ /dev/null
-Module M
- Sub Main()
-
-
- Dim b!
- b=20R
-
- End Sub
-End Module
+++ /dev/null
-Imports System
-Module StringLiteral
- Sub Main()
- Try
- Dim a As String="Hello"
- Dim b As String="World"
- Dim c As String=a*b
- Catch e As Exception
- Console.WriteLine(e.Message)
- End Try
-
- End Sub
-End Module
+++ /dev/null
-Imports System
-Module StringLiteral
- Sub Main()
- Try
- Dim a As String="Hello"
- Dim b As String=" World "
- Dim c As String=47
- Dim d As String=a+b+c
- If d<>"Hello World 47" Then
- Throw New Exception("StringLiteralA:Failed-String concatenation does not work right")
- End If
- Catch e As Exception
- Console.WriteLine(e.Message)
- End Try
-
- End Sub
-End Module
+++ /dev/null
-Imports System
-Module StringLiteral
- Sub Main()
- Try
- Dim a As String='Hello'
- Dim b As String=Hello
- Catch e As Exception
- Console.WriteLine(e.Message)
- End Try
-
- End Sub
-End Module
+++ /dev/null
-Module M
- Sub Main()
- Dim a$
- a="Hello"
-
- Dim b As String
- b$="Hello"
-
- Dim c$
- c$="Hello"
- End Sub
-End Module
+++ /dev/null
-Module StringTypeCharTest\r
- Sub Main()\r
- Try\r
- Dim m As String\r
- m = f(20)\r
- If m <> 20 Then\r
- Throw New Exception("StringTypeCharTest: failed")\r
- End If\r
- Exit Sub\r
- Catch e As Exception\r
- Console.WriteLine(e.Message)\r
- End Try\r
- End Sub\r
-\r
- Function f$(ByVal param$)\r
- f$ = param\r
- End Function\r
-End Module\r
+++ /dev/null
-Module M
- Sub Main()
- Dim a 'Default type assigned is Object
- a$="Hello" 'String type character does not conform with assigned type Object
-
- Dim b As String
- b$=10L 'Long type character does not conform with assigned type String
-
- Dim c $
-
- End Sub
-End Module
+++ /dev/null
-Module M
- Sub Main()
-
-
- Dim b$
- b=20D
-
- End Sub
-End Module
+++ /dev/null
-Imports System\r
-\r
-Module Variables\r
- Sub Main()\r
- Dim a As Integer\r
- If a<>0 Then\r
- Throw New Exception("Variables : Failed-Error assigning default value to variables")\r
- End If\r
- Dim b 'Default type is Object\r
- If b<>"" Then\r
- Throw New Exception("Variables : Failed-Error in implicit conversion of Object to string")\r
- End If\r
- If b<>0 Then\r
- Throw New Exception("Variables : Failed-Error in implicit conversion of Object to integer")\r
- End If\r
- If b<>0.0 Then\r
- Throw New Exception("Variables : Failed-Error in implicit conversion of Object to double")\r
- End If\r
- End Sub\r
-End Module\r
+++ /dev/null
-Imports System\r
-\r
-Module Variables\r
- Sub Main()\r
- a=20\r
- End Sub\r
-End Module\r