Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This uses the Bash Automated Testing System at https://github.com/sstephenson/bats as a framework for testing this command line utility.
As a start, I have made:
a) command_params.bats - basic tests to see that each generic command option ( -h, -v etc) works
b) display_ipv4.bats - at first 3 tests to check the output for the 3 old-fashioned "classes" of IPv4 private space at their most basic, using CIDRs that match the "classes". When I made these, I found a little bug in the RFC reference number (see misc.c - the fix is required so that the tests will pass)
c) validate_address_ipv4.bats - check a lot of variations of things that are, or look a bit like, IPv4 addresses.
d) validate_address_ipv6.bats - check a lot of variations of things that are, or look a bit like, IPv6 addresses.
Since I have managed to find a first bug while writing tests, I will submit this PR for your consideration.