Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var TestConfigs map[string]*pb.GlobalConfig = map[string]*pb.GlobalConfig{ "Expr/Eval": { Manifests: []*pb.AttributeManifest{ { Attributes: map[string]*pb.AttributeManifest_AttributeInfo{ "a": { ValueType: pbv.INT64, }, "request.user": { ValueType: pbv.STRING, }, "request.user2": { ValueType: pbv.STRING, }, "request.user3": { ValueType: pbv.STRING, }, "source.name": { ValueType: pbv.STRING, }, "source.target": { ValueType: pbv.STRING, }, "request.size": { ValueType: pbv.INT64, }, "request.size1": { ValueType: pbv.INT64, }, "x": { ValueType: pbv.INT64, }, "y": { ValueType: pbv.INT64, }, "service.name": { ValueType: pbv.STRING, }, "service.user": { ValueType: pbv.STRING, }, "origin.name": { ValueType: pbv.STRING, }, "request.header": { ValueType: pbv.STRING_MAP, }, "request.time": { ValueType: pbv.TIMESTAMP, }, "headername": { ValueType: pbv.STRING, }, "target.ip": { ValueType: pbv.IP_ADDRESS, }, "servicename": { ValueType: pbv.STRING, }, }, }, }, }, "Default": { Manifests: []*pb.AttributeManifest{ { Attributes: map[string]*pb.AttributeManifest_AttributeInfo{ "ai": { ValueType: pbv.INT64, }, "ab": { ValueType: pbv.BOOL, }, "as": { ValueType: pbv.STRING, }, "ad": { ValueType: pbv.DOUBLE, }, "ar": { ValueType: pbv.STRING_MAP, }, "adur": { ValueType: pbv.DURATION, }, "at": { ValueType: pbv.TIMESTAMP, }, "aip": { ValueType: pbv.IP_ADDRESS, }, "bi": { ValueType: pbv.INT64, }, "bb": { ValueType: pbv.BOOL, }, "bs": { ValueType: pbv.STRING, }, "bd": { ValueType: pbv.DOUBLE, }, "br": { ValueType: pbv.STRING_MAP, }, "bdur": { ValueType: pbv.DURATION, }, "bt": { ValueType: pbv.TIMESTAMP, }, "t1": { ValueType: pbv.TIMESTAMP, }, "t2": { ValueType: pbv.TIMESTAMP, }, "bip": { ValueType: pbv.IP_ADDRESS, }, "b1": { ValueType: pbv.BOOL, }, "b2": { ValueType: pbv.BOOL, }, "sm": { ValueType: pbv.STRING_MAP, }, }, }, }, }, }
TestConfigs uses a standard set of configs to use when executing tests.
View Source
var TestData = []TestInfo{}/* 145 elements not displayed */
Functions ¶
Types ¶
type FakeBag ¶
type FakeBag struct {
Attrs map[string]interface{}
}
FakeBag is a fake implementation of the Bag for testing purposes.
func (*FakeBag) DebugString ¶
DebugString is needed to implement the Bag interface.
type TestInfo ¶
type TestInfo struct { // E contains the expression that is being tested. E string // IL contains the textual IL representation of code. IL string // I contains the attribute bag used for testing. I map[string]interface{} // R contains the expected result of a successful evaluation. R interface{} // Err contains the expected error message of a failed evaluation. Err string // AstErr contains the expected error message of a failed evaluation, during AST evaluation. AstErr string // CompileErr contains the expected error message for a failed compilation. CompileErr string // Config field holds the GlobalConfig to use when compiling/evaluating the tests. // If nil, then "Default" config will be used. Conf *pb.GlobalConfig // SkipAst indicates that AST based evaluator should not be used for this test. SkipAst bool }
TestInfo is a structure that contains detailed test information. Depending on the test type, various fields of the TestInfo struct will be used for testing purposes. For example, compiler can use E and IL to test expression => IL conversion, interpreter can use IL and I, R&Err for evaluation tests and the evaluator can use expression and I, R&Err to test evaluation.
Click to show internal directories.
Click to hide internal directories.