mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-29 15:13:28 +00:00
test: refacto dump test units
This commit is contained in:
@@ -83,8 +83,10 @@ pub fn writeNode(root: *parser.Node, writer: anytype) !void {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// writeHTMLTestFn is run by run_tests.zig
|
test "dump.writeHTML" {
|
||||||
pub fn writeHTMLTestFn(out: File) !void {
|
const out = try std.fs.openFileAbsolute("/dev/null", .{ .mode = .write_only });
|
||||||
|
defer out.close();
|
||||||
|
|
||||||
const file = try std.fs.cwd().openFile("test.html", .{});
|
const file = try std.fs.cwd().openFile("test.html", .{});
|
||||||
defer file.close();
|
defer file.close();
|
||||||
|
|
||||||
|
|||||||
@@ -99,8 +99,11 @@ pub fn main() !void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
test {
|
test {
|
||||||
const TestAsync = @import("async/test.zig");
|
const AsyncTest = @import("async/test.zig");
|
||||||
std.testing.refAllDecls(TestAsync);
|
std.testing.refAllDecls(AsyncTest);
|
||||||
|
|
||||||
|
const DumpTest = @import("browser/dump.zig");
|
||||||
|
std.testing.refAllDecls(DumpTest);
|
||||||
}
|
}
|
||||||
|
|
||||||
test "jsruntime" {
|
test "jsruntime" {
|
||||||
@@ -138,15 +141,6 @@ test "bug document html parsing #4" {
|
|||||||
parser.documentHTMLClose(doc) catch {};
|
parser.documentHTMLClose(doc) catch {};
|
||||||
}
|
}
|
||||||
|
|
||||||
const dump = @import("browser/dump.zig");
|
|
||||||
test "run browser tests" {
|
|
||||||
// const out = std.io.getStdOut();
|
|
||||||
const out = try std.fs.openFileAbsolute("/dev/null", .{ .mode = .write_only });
|
|
||||||
defer out.close();
|
|
||||||
|
|
||||||
try dump.HTMLFileTestFn(out);
|
|
||||||
}
|
|
||||||
|
|
||||||
test "Window is a libdom event target" {
|
test "Window is a libdom event target" {
|
||||||
var window = Window.create(null);
|
var window = Window.create(null);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user