diff --git a/comp/src/gb.test/.src/Assert.class b/comp/src/gb.test/.src/Assert.class index 320a06056..3d0f58a44 100644 --- a/comp/src/gb.test/.src/Assert.class +++ b/comp/src/gb.test/.src/Assert.class @@ -351,16 +351,12 @@ Public Sub StringEquals(Got As String, Expected As String, Optional Description bRes = Equals(Got, Expected, Description) If Not bRes Then If Len(Got) <> Len(Expected) Then - Note(("Strings are of different length.")) - Note(Subst$((" Got: &1"), Len(Got))) - Note(Subst$((" Expected: &1"), Len(Expected))) + Note(Subst$(("Strings are of different lengths &1 and &2, respectively."), Len(Got), Len(Expected))) Endif For iPos = 1 To Min(Len(Got), Len(Expected)) If Mid$(Got, iPos, 1) <> Mid$(Expected, iPos, 1) Then Break Next - Note(Subst$(("Strings differ at position &1"), iPos)) - Note(Subst$((" Got: &1"), Quote$(Mid$(Got, iPos, 20)) & IIf(Len(Got) > iPos + 20, "...", ""))) - Note(Subst$((" Expected: &1"), Quote$(Mid$(Expected, iPos, 20)) & IIf(Len(Expected) > iPos + 20, "...", ""))) + Note(Subst$(("Strings differ at position &1."), iPos)) Endif Return bRes diff --git a/comp/src/gb.test/.src/TestMe.module b/comp/src/gb.test/.src/TestMe.module index beef68a8e..aef8bfae5 100644 --- a/comp/src/gb.test/.src/TestMe.module +++ b/comp/src/gb.test/.src/TestMe.module @@ -12,10 +12,10 @@ Public Sub Main() ' Here every test must fail: UnitTest.Main("TestFailures", Null, True, True, True) - UnitTest.Main("TestBailout", Null, True, True, True) + ' UnitTest.Main("TestBailout", Null, True, True, True) 'This will BailOut - UnitTest.Main("TestEmpty", Null, True) + ' UnitTest.Main("TestEmpty", Null, True) 'Test all diff --git a/comp/src/gb.test/.src/TestSuite/TestCase.class b/comp/src/gb.test/.src/TestSuite/TestCase.class index 8a2ea7d60..24a19cb91 100644 --- a/comp/src/gb.test/.src/TestSuite/TestCase.class +++ b/comp/src/gb.test/.src/TestSuite/TestCase.class @@ -43,7 +43,10 @@ Public Sub Run() Object.Call($MyTestModule, "SetupEach") Endif - Object.Call($MyTestModule, Me.name) + Try Object.Call($MyTestModule, Me.name) + If Error Then + Assert.Fail(Subst$("&1:&2 crashed with error '&3'", $MyTestModule.Name, Me.Name, Error.Text)) + Endif If $MyTestModule.Symbols.Exist("TeardownEach") Then Object.Call($MyTestModule, "TeardownEach") diff --git a/comp/src/gb.test/.src/TestSuite/TestSuite.class b/comp/src/gb.test/.src/TestSuite/TestSuite.class index 1f2485d6b..c480e2b14 100644 --- a/comp/src/gb.test/.src/TestSuite/TestSuite.class +++ b/comp/src/gb.test/.src/TestSuite/TestSuite.class @@ -34,6 +34,7 @@ Public Sub Run() StartTestModule(CurrentTestModule) Endif + Assert.Note(Subst$(("Entering subtest &1:&2"), oTest.TestModule.Name, oTest.Name)) Assert.Subtest(Subst$("&1:&2", oTest.TestModule.Name, oTest.Name)) oTest.Run() If Not Assert.Finished Then Assert.Finish()