bugfix: unittests

This commit is contained in:
jamesread 2024-02-22 23:42:40 +00:00
parent 0c5a99cc03
commit a8e770726a
2 changed files with 7 additions and 3 deletions

View File

@ -63,7 +63,7 @@ func TestExecNonExistant(t *testing.T) {
wg.Wait() wg.Wait()
assert.Equal(t, int32(-1337), req.logEntry.ExitCode, "Log entry is set to an internal error code") assert.Equal(t, int32(-1337), req.logEntry.ExitCode, "Log entry is set to an internal error code")
assert.Equal(t, "", req.logEntry.ActionIcon, "Log entry icon wasnt found") assert.Equal(t, "💩", req.logEntry.ActionIcon, "Log entry icon is a poop (not found)")
} }
func TestArgumentNameCamelCase(t *testing.T) { func TestArgumentNameCamelCase(t *testing.T) {

View File

@ -100,8 +100,12 @@ func testBase(t *testing.T, expire int64, expectCode int) {
*/ */
go func() { go func() {
if err := srv.Serve(lis); err != nil { if lis == nil {
t.Errorf("couldn't start server: %v", err) t.Errorf("couldn't start server: listener is null")
} else {
if err := srv.Serve(lis); err != nil {
t.Errorf("couldn't start server: %v", err)
}
} }
}() }()