type testBuiltins struct { expr string val value.Value } var ( // This is used so we have a constant understood time for message context // normally we would use time.Now() // "Apr 7, 2014 4:58:55 PM" ts = time.Date(2014, 4, 7, 16, 58, 55, 00, time.UTC) ts2 = time.Date(2014, 4, 7, 0, 0, 0, 00, time.UTC) readContext = datasource.NewContextUrlValuesTs(url.Values{ "event": {"hello"}, "reg_date": {"10/13/2014"}, "price": {"$55"}, "email": {"*****@*****.**"}, "url": {"http://www.site.com/membership/all.html"}, "score_amount": {"22"}, "tag_name": {"bob"}, }, ts) float3pt1 = float64(3.1) ) var builtinTests = []testBuiltins{ {`join(["apple","peach"], ",")`, value.NewStringValue("apple,peach")}, {`eq(5,5)`, value.BoolValueTrue}, {`eq('hello', event)`, value.BoolValueTrue}, {`eq(5,6)`, value.BoolValueFalse}, {`eq(true,eq(5,5))`, value.BoolValueTrue},
} type testBuiltins struct { expr string val value.Value } var ( // This is used so we have a constant understood time for message context // normally we would use time.Now() // "Apr 7, 2014 4:58:55 PM" ts = time.Date(2014, 4, 7, 16, 58, 55, 00, time.UTC) readContext = datasource.NewContextUrlValuesTs(url.Values{ "event": {"hello"}, "reg_date": {"10/13/2014"}, "price": {"$55"}, "email": {"*****@*****.**"}, "score_amount": {"22"}, }, ts) float3pt1 = float64(3.1) ) var builtinTests = []testBuiltins{ {`eq(5,5)`, value.BoolValueTrue}, {`eq('hello', event)`, value.BoolValueTrue}, {`eq(5,6)`, value.BoolValueFalse}, {`eq(true,eq(5,5))`, value.BoolValueTrue}, {`eq(true,false)`, value.BoolValueFalse}, {`ne(5,5)`, value.BoolValueFalse},