Skip to content

Commit

Permalink
test: update test to use mock_input
Browse files Browse the repository at this point in the history
  • Loading branch information
nilslice committed May 21, 2024
1 parent d87c30d commit 393de23
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions examples/basic.zig
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ const CountVowel = struct {

export fn @"test"() i32 {
const xtp_test = Test.init(std.heap.wasm_allocator);
const notEmpty = xtp_test.call("count_vowels", xtp_test.mockInput() catch unreachable) catch unreachable;
xtp_test.assert("with mock, not empty", !std.mem.eql(u8, notEmpty, ""), "expected non-empty string");
xtp_test.assertEq("this is a test", true, true);
xtp_test.assertGt("gt test", 10, 1);
xtp_test.assertGte("gte test", 10.4, 10.4);
Expand Down

0 comments on commit 393de23

Please sign in to comment.