func TestFunctionGetMaxWorkerSize(t *testing.T) {
	t.Log("Testing worker size initialization")
	config := &Config{MaxWorkerSize: 0}
	if r := config.GetMaxWorkerSize(); r != runtime.NumCPU()+1 {
		t.Errorf("Expected worker size from default value was %d but it was %d instead", runtime.NumCPU()+1, r)
	}
	config = &Config{MaxWorkerSize: 433}
	if r := config.GetMaxWorkerSize(); r != 433 {
		t.Errorf("Expected worker size from configuration was %d but it was %d instead", 433, r)
	}
	os.Setenv("HAMUSTRO_MAX_WORKER_SIZE", "22")
	defer os.Unsetenv("HAMUSTRO_MAX_WORKER_SIZE")
	if r := config.GetMaxWorkerSize(); r != 22 {
		t.Errorf("Expected worker size from environment variable was %d but it was %d instead", 22, r)
	}
}
Testing worker size calculation
package main
import (
	"os"
	"runtime"
	"testing"
)
func TestFunctionIsValid(t *testing.T) {
	t.Log("Testing configs")
	config := &Config{}
	if config.IsValid() {
		t.Errorf("Config without `shared_secret` and `dialect` can not be valid")
	}
	config = &Config{Dialect: "sth"}
	if config.IsValid() == true {
		t.Errorf("Config without `shared_secret` can not be valid")
	}
	config = &Config{SharedSecret: "ultrasafesecret"}
	if config.IsValid() == true {
		t.Errorf("Config without `dialect` can not be valid")
	}
}
func TestFunctionIsSignatureRequired(t *testing.T) {
	cases := []struct {
		Config         *Config
		ExpectedResult bool
	}{
		{&Config{}, true},
		{&Config{Signature: "required"}, true},
		{&Config{Signature: "not-existing-property"}, true},
		{&Config{Signature: "optional"}, false}}
	for _, c := range cases {
		if r := c.Config.IsSignatureRequired(); r != c.ExpectedResult {
			t.Errorf("Expected signature requirements was %s but it was %s instead", c.ExpectedResult, r)
		}
	}
}