jamesread 2 лет назад
Родитель
Сommit
a8e770726a
2 измененных файлов с 7 добавлено и 3 удалено
  1. 1 1
      internal/executor/executor_test.go
  2. 6 2
      internal/httpservers/restapi_test.go

+ 1 - 1
internal/executor/executor_test.go

@@ -63,7 +63,7 @@ func TestExecNonExistant(t *testing.T) {
 	wg.Wait()
 
 	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) {

+ 6 - 2
internal/httpservers/restapi_test.go

@@ -100,8 +100,12 @@ func testBase(t *testing.T, expire int64, expectCode int) {
 	*/
 
 	go func() {
-		if err := srv.Serve(lis); err != nil {
-			t.Errorf("couldn't start server: %v", err)
+		if lis == nil {
+			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)
+			}
 		}
 	}()