This prevents STDOUT lines from appearing out of order relative to
STDERR lines in the test log, which makes it much easier to understand
what's happening.
Devel::Autoflush is from https://metacpan.org/pod/Devel::Autoflush and
is licensed under the terms of the Apache 2.0 license.
Installing with `make install` automatically places the ddclient
executable in `/usr/bin/ddclient`. This service file has the wrong
path and that causes systemd to be unable to start ddclient.
Apparently it is enough to simply import Socket or IO::Socket to use
AF_INET and friends, but all examples in official documentation show
them in the import list. Because I do not fully understand the
intricacies of Perl import logic, I do the same thing here, fully
aware that I might have joined a cargo cult. Regardless of its
correctness or necessity, listing the constants in the import list has
the advantage of making it clear why the `use` statement exists.
I chose to import the constants from Socket instead of IO::Socket
because that module's documentation explicitly documents the
constants.
The version of Test::More available in CentOS/RHEL 6 doesn't include
`subtest`, which we want to use. We can revert this commit once we
drop support for CentOS/RHEL 6.
The code is licensed under the same terms as Perl 5 itself:
https://github.com/Test-More/test-more/blob/v1.302175/LICENSE
CentOS and RHEL have a `perl-core` metapackage that depends on all
packages providing core modules.
Fedora's `perl` package is equivalent to the CentOS/RHEL `perl-core`
package, and its `perl-interpreter` package is equivalent to the
CentOS/RHEL `perl` package.
Now the following valid URLs are parsed correctly:
* http://[::1]:123/foo
* http://localhost?foo=bar
There are still problems with the URL parsing logic but this is enough
to write some unit tests.
The IO::Socket classes expect strings for the port number because you
can pass service names from `/etc/services`. Numbers work too, but
using strings everywhere makes it easier to write unit tests.