Commit fffe0cc8 authored by Christof Thalhofer's avatar Christof Thalhofer

gb.test ignore case in test fixtures' method names

[GB.TEST]
* BUG: gb.test ignore case of method names of test fixtures
parent 17ab56cf
......@@ -5,19 +5,19 @@
Private $Done As New String[]
Public Sub _Setup()
Public Sub _SeTuP()
$Done.Add("Setup")
End
Public Sub _SetupEach()
Public Sub _SeTuPeAcH()
$Done.Add("SetupEach")
End
Public Sub _TeardownEach()
Public Sub _TeArDoWneAcH()
$Done.Add("TeardownEach")
......@@ -41,11 +41,12 @@ Public Sub B()
End
Public Sub _Teardown()
Public Sub _TeArDoWn()
$Done.Add("Teardown")
If $Done.Join() <> "Setup,SetupEach,A,TeardownEach,SetupEach,B,TeardownEach,Teardown" Then
Test.BailOut("_Teardown failed")
'Assertion forbidden inside _Setup or _Teardown, so we can just bail out to report the failure
Test.BailOut("_Teardown failed. Expected '" & "Setup,SetupEach,A,TeardownEach,SetupEach,B,TeardownEach,Teardown'" & " but got '" & $Done.Join() & "'")
Endif
End
......@@ -39,7 +39,7 @@ Public Sub Run()
Assert $MyTestModule
'$MyTestModule._SetupEach
If $MyTestModule.Symbols.Exist("_SetupEach") Then
If $MyTestModule.Symbols.Exist("_SetupEach", gb.IgnoreCase) Then
Test._InSetup = True
Object.Call($MyTestModule, "_SetupEach")
Test._InSetup = False
......@@ -50,7 +50,7 @@ Public Sub Run()
Assert.Fail(Subst$("&1:&2 crashed with error '&3'", $MyTestModule.Name, Me.Name, Error.Text))
Endif
If $MyTestModule.Symbols.Exist("_TeardownEach") Then
If $MyTestModule.Symbols.Exist("_TeardownEach", gb.IgnoreCase) Then
Test._InSetup = True
Object.Call($MyTestModule, "_TeardownEach")
Test._InSetup = False
......
......@@ -52,7 +52,7 @@ End Sub
Private Sub StartTestModule(TestModule As Class)
If TestModule.Symbols.Exist("_Setup") Then
If TestModule.Symbols.Exist("_Setup", gb.IgnoreCase) Then
Test._InSetup = True
Object.Call(TestModule, "_Setup")
Test._InSetup = False
......@@ -62,7 +62,7 @@ End
Private Sub StopTestModule(TestModule As Class)
If TestModule.Symbols.Exist("_Teardown") Then
If TestModule.Symbols.Exist("_Teardown", gb.IgnoreCase) Then
Test._InSetup = True
Object.Call(TestModule, "_Teardown")
Test._InSetup = False
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment