summaryrefslogtreecommitdiffstats
path: root/basic/qa/basic_coverage/test_optional_paramter_type.bas
diff options
context:
space:
mode:
Diffstat (limited to 'basic/qa/basic_coverage/test_optional_paramter_type.bas')
-rw-r--r--basic/qa/basic_coverage/test_optional_paramter_type.bas34
1 files changed, 34 insertions, 0 deletions
diff --git a/basic/qa/basic_coverage/test_optional_paramter_type.bas b/basic/qa/basic_coverage/test_optional_paramter_type.bas
new file mode 100644
index 000000000..2a616c240
--- /dev/null
+++ b/basic/qa/basic_coverage/test_optional_paramter_type.bas
@@ -0,0 +1,34 @@
+REM ***** BASIC *****
+Option Compatible
+Option Explicit
+
+Function doUnitTest() As String
+ doUnitTest = "FAIL"
+ If CheckType1(32) = 0 Then
+ Exit Function
+ End If
+ If CheckType2(32) = 0 Then
+ Exit Function
+ End If
+ If CheckType2() = 0 Then
+ Exit Function
+ End If
+ doUnitTest = "OK"
+End Function
+
+Function CheckType1(x As Integer) As Integer
+ If TypeName(x) = "Integer" Then
+ CheckType1 = 1
+ Else
+ CheckType1 = 0
+ End If
+End Function
+
+
+Function CheckType2(Optional y As Integer = 32 ) As Integer
+ If TypeName(y) = "Integer" Then
+ CheckType2 = 1
+ Else
+ CheckType2 = 0
+ End If
+End Function \ No newline at end of file