Skip to content

Commit 20fbcae

Browse files
committed
remove wasm attempt for now
1 parent 60c85e5 commit 20fbcae

File tree

10 files changed

+299
-1277
lines changed

10 files changed

+299
-1277
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.zig-cache/
2-
zig-out/
2+
zig-out/
3+
.DS_Store

src/httpfile/assertion_checker.zig

Lines changed: 282 additions & 114 deletions
Large diffs are not rendered by default.

src/httpfile/parser.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const ArrayList = std.ArrayList;
66

77
const ParserState = enum { headers, body };
88

9-
const AssertionType = enum {
9+
pub const AssertionType = enum {
1010
equal,
1111
not_equal,
1212
contains,

src/main.zig

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,14 @@ fn runTest(
125125
return;
126126
};
127127
defer responses.deinit();
128-
AssertionChecker.check(owned_item, responses, std.io.getStdErr().writer()) catch {
128+
var diagnostic = AssertionChecker.AssertionDiagnostic.init(allocator);
129+
defer diagnostic.deinit();
130+
AssertionChecker.check(owned_item, responses, &diagnostic, path);
131+
if (AssertionChecker.hasFailures(&diagnostic)) {
132+
AssertionChecker.reportFailures(&diagnostic, std.io.getStdErr().writer()) catch {};
129133
has_failure = true;
130134
break;
131-
};
135+
}
132136
}
133137
if (!has_failure) {
134138
reporter.incTestPass();

src/wasm.zig

Lines changed: 0 additions & 283 deletions
This file was deleted.

test.httpspec

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,11 @@ GET https://jsonplaceholder.typicode.com/users/1
33
Accept: application/json
44

55
//# status == 200
6-
//# body contains "Leanne Graham"
6+
//# body contains "Leanne Graham"
7+
8+
### Test with some failing assertions (to show diagnostics)
9+
GET https://httpbin.org/json
10+
11+
//# status == 404
12+
//# body contains "nonexistent"
13+
//# header["content-type"] == "text/plain"

0 commit comments

Comments
 (0)