sqlite-wasm/testdata/addupto.zig
jmug 64f41ad5b9 Change the step
Signed-off-by: jmug <u.g.a.mariano@gmail.com>
2025-04-28 00:36:32 -07:00

15 lines
288 B
Zig

const expect = @import("std").testing.expect;
pub export fn addUpTo(to: u32) u32 {
var res: u32 = 0;
for (0..to) |_| {
res += to;
}
return res;
}
test "addUpTo" {
const expected: u32 = 15;
const actual = addUpTo(6);
try expect(actual == expected);
}