gambas-source-code/main/lib/test/gb.test/.src/TestMyself/TElse.test
Christof Thalhofer 09da14aa68 gb.test plan selftests and taskell
[GB.TEST]
*NEW: plan selftests
*NEW: forbid assertions in _Setup.. and _Teardown.. to ensure plan is always valid
2020-06-06 12:08:14 +02:00

58 lines
1.7 KiB
Text

' Gambas test file
Public Sub NoMessage()
'There is no message
Test.Plan(1)
Assert.Ok(True)
End
Public Sub NoMessageInbetween()
Test.Plan(4)
Assert.Ok(True, "TestNoMessageInbetween Assert 1 description defined")
Assert.Ok(True)
Assert.Ok(True, "Assert 3 description defined")
Assert.Ok(True)
End
Public Sub Note()
Test.Note("This\nis\na\nnote")
Test.Plan(0)
Test.Note("The next note is Null and that's alright:")
Test.Note(Null)
Test.SkipAll("This doesn't actually assert anything")
End
Public Sub TestNoteGotAndExpected()
'tests the typo of Expected and Got in diagnosis
'This test must fail to see what happens
Dim Expected, Got As String
Test.Plan(1)
Got = "<ol class='ulist'>" & gb.Lf &
" <li>Zum 15.12. in die Wintermischung 2</li> " & gb.Lf &
" <li>Zum 15.2. in die Fellwechselmischung Frühjahr</li> " & gb.Lf &
" <li>Zum 15.4. in die Sommermischung</li> " & gb.Lf &
" <li>Zum 15.8. in die Fellwechselmischung Herbst</li> " & gb.Lf &
" <li>Zum 15.10. in die Wintermischung 1</li> " & gb.Lf &
"</ol>"
Expected = "<ol class='ulist'>" & gb.Lf &
Trim(" <li>Zum 15.12. in die Wintermischung 2</li> ") & gb.Lf &
Trim(" <li>Zum 15.2. in die Fellwechselmischung Frühjahr</li> ") & gb.Lf &
Trim(" <li>Zum 15.4. in die Sommermischung</li> ") & gb.Lf &
Trim(" <li>Zum 15.8. in die Fellwechselmischung Herbst</li> ") & gb.Lf &
Trim(" <li>Zum 15.10. in die Wintermischung 1</li> ") & gb.Lf &
"</ol>"
Assert.Equals(Got, Expected, "tests the typo of Expected and Got in diagnosis")
End