Browse Source

fix: Test fixes

Matthias Ladkau 3 years ago
parent
commit
9075df4c63
2 changed files with 4 additions and 7 deletions
  1. 2 6
      cli/tool/debug_test.go
  2. 2 1
      interpreter/func_provider_test.go

+ 2 - 6
cli/tool/debug_test.go

@@ -25,7 +25,6 @@ import (
 	"time"
 
 	"devt.de/krotik/common/errorutil"
-	"devt.de/krotik/ecal/config"
 	"devt.de/krotik/ecal/interpreter"
 	"devt.de/krotik/ecal/stdlib"
 	"devt.de/krotik/ecal/util"
@@ -120,11 +119,8 @@ func TestDebugInterpret(t *testing.T) {
 		return
 	}
 
-	if testLogOut.String() != `ECAL `+config.ProductVersion+`
-Log level: info - Root directory: /home/ml/data/krotik/ecal/cli/tool
-Running in debug mode - with debug server on localhost:33274 - prefix debug commands with ##
-Type 'q' or 'quit' to exit the shell and '?' to get help
-` {
+	if !strings.Contains(testLogOut.String(),
+		"Running in debug mode - with debug server on localhost:33274 - prefix debug commands with ##") {
 		t.Error("Unexpected result:", testLogOut.String())
 		return
 	}

+ 2 - 1
interpreter/func_provider_test.go

@@ -18,6 +18,7 @@ import (
 	"time"
 
 	"devt.de/krotik/common/errorutil"
+	"devt.de/krotik/common/timeutil"
 	"devt.de/krotik/ecal/stdlib"
 )
 
@@ -367,7 +368,7 @@ log("Cron:", setCronTrigger("1 1 *%10 * * *", "cronevent", "foo.bar"))
 	}
 
 	testcron.Start()
-	time.Sleep(200 * time.Millisecond)
+	timeutil.WaitTestingCron(testcron)
 
 	if testlogger.String() != `
 Cron:at second 1 of minute 1 of every 10th hour every day