forked from mirror/client_golang
Rename test helper files to helpers_test.go
This ensures that these files are properly included only in testing. [Fixes #10]
This commit is contained in:
parent
8296a0cb49
commit
af56a93a80
|
@ -38,3 +38,18 @@ func isNaN(obtained interface{}) (result bool) {
|
||||||
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type valueEqualsChecker struct {
|
||||||
|
*CheckerInfo
|
||||||
|
}
|
||||||
|
|
||||||
|
var ValueEquals Checker = &valueEqualsChecker{
|
||||||
|
&CheckerInfo{Name: "IsValue", Params: []string{"obtained", "expected"}},
|
||||||
|
}
|
||||||
|
|
||||||
|
func (checker *valueEqualsChecker) Check(params []interface{}, names []string) (result bool, error string) {
|
||||||
|
actual := params[0].(*item).Value
|
||||||
|
expected := params[1]
|
||||||
|
|
||||||
|
return actual == expected, ""
|
||||||
|
}
|
|
@ -1,26 +0,0 @@
|
||||||
// Copyright (c) 2013, Prometheus Team
|
|
||||||
// All rights reserved.
|
|
||||||
//
|
|
||||||
// Use of this source code is governed by a BSD-style
|
|
||||||
// license that can be found in the LICENSE file.
|
|
||||||
|
|
||||||
package prometheus
|
|
||||||
|
|
||||||
import (
|
|
||||||
. "github.com/matttproud/gocheck"
|
|
||||||
)
|
|
||||||
|
|
||||||
type valueEqualsChecker struct {
|
|
||||||
*CheckerInfo
|
|
||||||
}
|
|
||||||
|
|
||||||
var ValueEquals Checker = &valueEqualsChecker{
|
|
||||||
&CheckerInfo{Name: "IsValue", Params: []string{"obtained", "expected"}},
|
|
||||||
}
|
|
||||||
|
|
||||||
func (checker *valueEqualsChecker) Check(params []interface{}, names []string) (result bool, error string) {
|
|
||||||
actual := params[0].(*item).Value
|
|
||||||
expected := params[1]
|
|
||||||
|
|
||||||
return actual == expected, ""
|
|
||||||
}
|
|
Loading…
Reference in New Issue