test/README.md (view raw)
1# Testing
2
3`mdget` includes a comprehensive Makefile-based test suite. To run all tests:
4
5 make test-all
6
7Or simply:
8
9 make
10
11The test suite covers:
12
13* **Command-line argument parsing**: tests for help, version, URL validation,
14and flag handling
15* **HTTP connectivity**: uses a mock HTTP server to test fetching and
16User-Agent headers
17* **HTML to Markdown conversion**: verifies proper conversion of headings,
18paragraphs, lists, links, and other elements
19* Tests writing results to files, for invalid URLs, timeouts, HTTP errors, and
20other failure scenarios.
21
22To run specific test categories:
23
24 make test-args # Test command-line arguments
25 make test-http # Test HTTP connectivity
26 make test-conversion # Test HTML to Markdown conversion
27 make test-output # Test file output
28 make test-errors # Test error conditions
29 make test-build # Test build and execution
30
31For a complete list of available commands:
32
33 make help
34