aboutsummaryrefslogtreecommitdiff
path: root/doc/langref/test_wasmMemoryGrow_builtin.zig
blob: 7f2dc3e1490a3fa2e980df0b3c79f6baa159af00 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
const std = @import("std");
const native_arch = @import("builtin").target.cpu.arch;
const expect = std.testing.expect;

test "@wasmMemoryGrow" {
    if (native_arch != .wasm32) return error.SkipZigTest;

    const prev = @wasmMemorySize(0);
    try expect(prev == @wasmMemoryGrow(0, 1));
    try expect(prev + 1 == @wasmMemorySize(0));
}

// test