Skip to content

Commit

Permalink
test: add decimal
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesrocket committed Jun 26, 2024
1 parent 53e4c0d commit 4f1346d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ pub fn build(b: *std.Build) void {
test_options.addOptionPath("exe_path", exe.getEmittedBin());

const integration_tests = b.addTest(.{
.root_source_file = b.path("tests/cli.zig"),
.root_source_file = b.path("test/cli.zig"),
.target = target,
.optimize = optimize,
});
Expand Down
16 changes: 16 additions & 0 deletions tests/cli.zig → test/cli.zig
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,19 @@ test "crypto" {

try std.testing.expectEqual(term, std.process.Child.Term{ .Exited = 0 });
}

test "decimal" {
const exe_path = build_options.exe_path;
const argv = [_][]const u8{ exe_path, "--time=short", "--decimal" };
const proc = try std.process.Child.run(.{
.allocator = std.testing.allocator,
.argv = &argv,
});

defer std.testing.allocator.free(proc.stdout);
defer std.testing.allocator.free(proc.stderr);

const term = proc.term;

try std.testing.expectEqual(term, std.process.Child.Term{ .Exited = 0 });
}

0 comments on commit 4f1346d

Please sign in to comment.