Skip to content

Commit 542fc84

Browse files
committed
Fix test cases
1 parent 90a6623 commit 542fc84

File tree

4 files changed

+14
-9
lines changed

4 files changed

+14
-9
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ zig build run -Dexamples=true
4141
In your zig project folder (where build.zig is located), run:
4242

4343
```bash
44-
zig fetch --save "git+https://github.com/Afirium/wasmer-zig-api#v0.2.0"
44+
zig fetch --save "git+https://github.com/Afirium/wasmer-zig-api#v0.3.0"
4545
```
4646

4747
Then, in your `build.zig`'s `build` function, add the following before
@@ -57,3 +57,9 @@ Then, in your `build.zig`'s `build` function, add the following before
5757
exe.addLibraryPath(.{ .cwd_relative = "/home/path_to_your_wasmer/.wasmer/lib" });
5858
exe.linkSystemLibrary("wasmer");
5959
```
60+
61+
## Status
62+
63+
| Refname | Wasmer runtime version | Zig `0.12.x` | Zig `0.13.x` | Zig `0.14.x` | Zig `0.15.0-dev` |
64+
|:----------|:-----------------------|:------------:|:------------:|:------------:|:----------------:|
65+
| `v0.3.0` | `v4.0.0+`, `v5.0.0+` |||||

build.zig.zon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.{
22
.fingerprint = 0xadae4aecca466a13,
33
.name = .wasmer_zig_api,
4-
.version = "0.2.0",
4+
.version = "0.3.0",
55
.minimum_zig_version = "0.14.0",
66
.paths = .{
77
"build.zig",

examples/wasi.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ pub fn run() !void {
5959

6060
std.log.info("loading binary...", .{});
6161

62-
const file_content = @embedFile("./assets/qjs.wasm");
62+
const file_content = @embedFile("assets/qjs.wasm");
6363

6464
var binary = wasmer.ByteVec.fromSlice(file_content);
6565
defer binary.deinit();

src/wasmer.zig

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ pub fn detectWasmerLibDir(allocator: std.mem.Allocator) !?[]const u8 {
3333
var child = std.process.Child.init(&argv, allocator);
3434
child.stdout_behavior = .Pipe;
3535
child.stderr_behavior = .Pipe;
36-
var stdout = std.ArrayListUnmanaged(u8) {};
37-
var stderr = std.ArrayListUnmanaged(u8) {};
36+
var stdout = std.ArrayListUnmanaged(u8){};
37+
var stderr = std.ArrayListUnmanaged(u8){};
3838
defer {
3939
stdout.deinit(allocator);
4040
stderr.deinit(allocator);
@@ -87,8 +87,6 @@ test "detect wasmer lib directory" {
8787
const result = try detectWasmerLibDir(std.testing.allocator) orelse "";
8888
defer std.testing.allocator.free(result);
8989

90-
std.debug.print("Wasmer lib path: {s}\n", .{result});
91-
9290
try std.testing.expectStringEndsWith(result, ".wasmer/lib");
9391
}
9492

@@ -104,7 +102,8 @@ test "transform WAT to WASM" {
104102
;
105103

106104
var wasm_bytes = try watToWasm(wat);
107-
defer wasm_bytes.deinit();
108105

109-
std.debug.print("Wasm2Wadt {any}", .{wasm_bytes});
106+
try std.testing.expectEqual(91, wasm_bytes.size);
107+
108+
defer wasm_bytes.deinit();
110109
}

0 commit comments

Comments
 (0)