also looking at this
test: make CI exercise maintained integrations
#18
16 files
+390
-139
| @@ -1,19 +1,25 @@ | ||
| 1 | 1 | const std = ; |
| 2 | const ztf = ; | |
| 2 | 3 | |
| 3 | // Placeholder tests for CLI module | |
| 4 | // TODO: Implement comprehensive tests for CLI parsing | |
| 5 | ||
| 6 | test "CLI parse help flag" { | |
| 7 | // Test --help flag parsing | |
| 8 | try std.testing.expect(true); | |
| 4 | test "CLI parses the help flag" { | |
| 5 | var cli = ztf.CLI.init(std.testing.allocator); | |
| 6 | try cli.parse(&.{ "zig-test", "--help" }); | |
| 7 | try std.testing.expect(cli.options.help); | |
| 9 | 8 | } |
| 10 | 9 | |
| 11 | test "CLI parse reporter option" { | |
| 12 | // Test --reporter option parsing | |
| 13 | try std.testing.expect(true); | |
| 10 | test "CLI parses a representative discovery invocation" { | |
| 11 | var cli = ztf.CLI.init(std.testing.allocator); | |
| 12 | try cli.parse(&.{ "zig-test", "--test-dir", "specs", "--grep", "database", "--coverage", "--no-color", "--bail" }); | |
| 13 | try std.testing.expectEqualStrings("specs", cli.options.test_dir.?); | |
| 14 | try std.testing.expectEqualStrings("database", cli.options.filter.?); | |
| 15 | try std.testing.expect(cli.options.coverage); | |
| 16 | try std.testing.expect(cli.options.no_color); | |
| 17 | try std.testing.expect(cli.options.bail); | |
| 14 | 18 | } |
| 15 | 19 | |
| 16 | test "CLI parse filter option" { | |
| 17 | // Test --filter option parsing | |
| 18 | try std.testing.expect(true); | |
| 20 | test "CLI rejects missing and invalid values" { | |
| 21 | var missing = ztf.CLI.init(std.testing.allocator); | |
| 22 | try std.testing.expectError(ztf.cli.CLIError.MissingValue, missing.parse(&.{ "zig-test", "--reporter" })); | |
| 23 | var invalid = ztf.CLI.init(std.testing.allocator); | |
| 24 | try std.testing.expectError(ztf.cli.CLIError.InvalidArgument, invalid.parse(&.{ "zig-test", "--jobs", "0" })); | |
| 19 | 25 | } |