5004f20609
[INTERPRETER] * NEW: Remove the now useless testing specific code. * NEW: 'gbx3 -T' now just loads the 'gb.test' component and calls Test.Main() passing it the '-T' option argument. [GB.TEST] * NEW: Move 'gb.test' sources in '/main/lib'. * NEW: 'gb.test' has now a part written in C that allows him to load project classes on demand.
61 lines
1.2 KiB
Text
61 lines
1.2 KiB
Text
' Gambas test file
|
|
|
|
''' Every test in this class failes, but is reverted to be reported as good
|
|
|
|
Public Sub TestStringFailure()
|
|
|
|
Assert.IntendedFailure()
|
|
Assert.StringEquals("Lisa", "Paul", "Intentional String failure. Ok if not ok.")
|
|
|
|
End
|
|
|
|
Public Sub TestLongFailure()
|
|
|
|
Assert.IntendedFailure()
|
|
Assert.Equals(2, 3, "Intentional Long failure. Ok if not ok.")
|
|
|
|
End
|
|
|
|
Public Sub TestLongTypeMismatchFailure()
|
|
|
|
Dim s As String = "3.0"
|
|
|
|
Assert.IntendedFailure()
|
|
Assert.Equals(s, 3, "Intentional Long type mismatch failure. Ok if not ok.")
|
|
|
|
End
|
|
|
|
Public Sub TestEqualsFailure()
|
|
|
|
Dim oOne, oTwo As Object
|
|
|
|
Test.Note("Equals failures")
|
|
Assert.IntendedFailure()
|
|
Assert.Equals(2, 3)
|
|
|
|
Assert.IntendedFailure()
|
|
Assert.Equals("3", 2.0)
|
|
|
|
Assert.IntendedFailure()
|
|
Assert.Equals("2", 2.1)
|
|
|
|
oOne = New Test
|
|
oTwo = New Test
|
|
Assert.IntendedFailure()
|
|
Assert.Equals(oOne, oTwo)
|
|
|
|
End
|
|
|
|
Public Sub TestError()
|
|
|
|
Dim a As Long
|
|
|
|
Try a = 3 / 0
|
|
Assert.IntendedFailure()
|
|
Assert.ErrorCode(5, "Wanted error 5. Ok if not ok.")
|
|
|
|
' No Error, AssertError has to report a failure
|
|
Assert.IntendedFailure()
|
|
Assert.Error("No Error but error expected. Ok if not ok.")
|
|
|
|
End
|