@@ -19,31 +19,47 @@ func TestRoundFunction(test *testing.T) {
1919 testCases := util.TestCases {
2020 "round-down" : {
2121 Request : function.RunRequest {
22- Arguments : function .NewArgumentsData ([]attr.Value {types .Float64Value (1.2 )}),
22+ Arguments : function .NewArgumentsData ([]attr.Value {types .Float64Value (1.2 ), types . TupleValueMust ([]attr. Type {}, []attr. Value {}) }),
2323 },
2424 Expected : function.RunResponse {
2525 Result : function .NewResultData (types .Int64Value (1 )),
2626 },
2727 },
2828 "round-up" : {
2929 Request : function.RunRequest {
30- Arguments : function .NewArgumentsData ([]attr.Value {types .Float64Value (1.8 )}),
30+ Arguments : function .NewArgumentsData ([]attr.Value {types .Float64Value (1.8 ), types . TupleValueMust ([]attr. Type {}, []attr. Value {}) }),
3131 },
3232 Expected : function.RunResponse {
3333 Result : function .NewResultData (types .Int64Value (2 )),
3434 },
3535 },
3636 "round-half" : {
3737 Request : function.RunRequest {
38- Arguments : function .NewArgumentsData ([]attr.Value {types .Float64Value (1.5 )}),
38+ Arguments : function .NewArgumentsData ([]attr.Value {types .Float64Value (1.5 ), types . TupleValueMust ([]attr. Type {}, []attr. Value {}) }),
3939 },
4040 Expected : function.RunResponse {
4141 Result : function .NewResultData (types .Int64Value (2 )),
4242 },
4343 },
44+ "round-half-even-true" : {
45+ Request : function.RunRequest {
46+ Arguments : function .NewArgumentsData ([]attr.Value {types .Float64Value (2.5 ), types .TupleValueMust ([]attr.Type {types .BoolType }, []attr.Value {types .BoolValue (true )})}),
47+ },
48+ Expected : function.RunResponse {
49+ Result : function .NewResultData (types .Int64Value (2 )),
50+ },
51+ },
52+ "round-half-even-false" : {
53+ Request : function.RunRequest {
54+ Arguments : function .NewArgumentsData ([]attr.Value {types .Float64Value (2.5 ), types .TupleValueMust ([]attr.Type {types .BoolType }, []attr.Value {types .BoolValue (false )})}),
55+ },
56+ Expected : function.RunResponse {
57+ Result : function .NewResultData (types .Int64Value (3 )),
58+ },
59+ },
4460 "beyond-upper-limit" : {
4561 Request : function.RunRequest {
46- Arguments : function .NewArgumentsData ([]attr.Value {types .NumberValue (func () * big.Float { f := new (big.Float ); f .SetString ("1e+310" ); return f }())}),
62+ Arguments : function .NewArgumentsData ([]attr.Value {types .NumberValue (func () * big.Float { f := new (big.Float ); f .SetString ("1e+310" ); return f }()), types . TupleValueMust ([]attr. Type {}, []attr. Value {}) }),
4763 },
4864 Expected : function.RunResponse {
4965 Result : resultData ,
@@ -52,7 +68,7 @@ func TestRoundFunction(test *testing.T) {
5268 },
5369 "overflow" : {
5470 Request : function.RunRequest {
55- Arguments : function .NewArgumentsData ([]attr.Value {types .Float64Value (9.223372036854777e+18 )}), // math.MaxInt64 + 1
71+ Arguments : function .NewArgumentsData ([]attr.Value {types .Float64Value (9.223372036854777e+18 ), types . TupleValueMust ([]attr. Type {}, []attr. Value {}) }), // math.MaxInt64 + 1
5672 },
5773 Expected : function.RunResponse {
5874 Result : resultData ,
0 commit comments