Commit 655ac0f2 authored by Kenton Varda's avatar Kenton Varda

Add test for kj::range().

parent 14ac59f9
......@@ -445,5 +445,19 @@ TEST(Common, ArrayAsBytes) {
}
}
KJ_TEST("kj::range()") {
uint expected = 5;
for (uint i: range(5, 10)) {
KJ_EXPECT(i == expected++);
}
KJ_EXPECT(expected == 10);
expected = 0;
for (uint i: range(0, 8)) {
KJ_EXPECT(i == expected++);
}
KJ_EXPECT(expected == 8);
}
} // namespace
} // namespace kj
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment