v2 / vlib / v / gen / wasm / serialise / alignment_test.v
12 lines · 10 sloc · 337 bytes · c42291948116b957642ea13e147342c362685ab4
Raw
1import v.ast
2import v.gen.wasm.serialise
3
4fn test_alignment() {
5 table := ast.new_table()
6
7 mut pool := serialise.new_pool(table)
8 pool.append(ast.BoolLiteral{ val: true }, 0) // +0, +1
9 pool.append(ast.FloatLiteral{ val: '0' }, ast.f32_type) // +3, +4
10 pool.append(ast.BoolLiteral{ val: true }, 0) // +0, +1
11 assert pool.buf.len == 9
12}
13