mirror of
https://github.com/openfaas/faas.git
synced 2025-06-09 08:46:48 +00:00
Previous PR from Simon or Ken broke build due to missing gofmt in the PR. This PR applies it to resolve the build issue. Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
33 lines
721 B
Go
33 lines
721 B
Go
package plugin
|
|
|
|
import "testing"
|
|
|
|
const fallbackValue = 120
|
|
|
|
func TestLabelValueWasEmpty(t *testing.T) {
|
|
extractedValue := extractLabelValue("", fallbackValue)
|
|
|
|
if extractedValue != fallbackValue {
|
|
t.Log("Expected extractedValue to equal the fallbackValue")
|
|
t.Fail()
|
|
}
|
|
}
|
|
|
|
func TestLabelValueWasValid(t *testing.T) {
|
|
extractedValue := extractLabelValue("42", fallbackValue)
|
|
|
|
if extractedValue != 42 {
|
|
t.Log("Expected extractedValue to equal answer to life (42)")
|
|
t.Fail()
|
|
}
|
|
}
|
|
|
|
func TestLabelValueWasInValid(t *testing.T) {
|
|
extractedValue := extractLabelValue("InvalidValue", fallbackValue)
|
|
|
|
if extractedValue != fallbackValue {
|
|
t.Log("Expected extractedValue to equal the fallbackValue")
|
|
t.Fail()
|
|
}
|
|
}
|