mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-29 07:03:29 +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
|
||||
pub fn writeHTMLTestFn(out: File) !void {
|
||||
test "dump.writeHTML" {
|
||||
const out = try std.fs.openFileAbsolute("/dev/null", .{ .mode = .write_only });
|
||||
defer out.close();
|
||||
|
||||
const file = try std.fs.cwd().openFile("test.html", .{});
|
||||
defer file.close();
|
||||
|
||||
|
||||
@@ -99,8 +99,11 @@ pub fn main() !void {
|
||||
}
|
||||
|
||||
test {
|
||||
const TestAsync = @import("async/test.zig");
|
||||
std.testing.refAllDecls(TestAsync);
|
||||
const AsyncTest = @import("async/test.zig");
|
||||
std.testing.refAllDecls(AsyncTest);
|
||||
|
||||
const DumpTest = @import("browser/dump.zig");
|
||||
std.testing.refAllDecls(DumpTest);
|
||||
}
|
||||
|
||||
test "jsruntime" {
|
||||
@@ -138,15 +141,6 @@ test "bug document html parsing #4" {
|
||||
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" {
|
||||
var window = Window.create(null);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user