未验证 提交 afdbf960 编写于 作者: E Ebrahim Byagowi 提交者: GitHub

[iter][test] Add another test for hb_reduce

Different initial and accumulator types
上级 bfa02bef
......@@ -181,6 +181,12 @@ main (int argc, char **argv)
;
// The result should be something like 0->10, 1->11, ..., 9->19
assert (hb_map_get (result, 9) == 19);
unsigned int temp3 = 0;
+ hb_iter(src)
| hb_map([&] (int i) -> int { return ++temp3; })
| hb_reduce([&] (float acc, int value) -> float { return acc + value + .05; }, 0)
;
hb_map_destroy (result);
+ hb_iter (src)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册