use strict;
use warnings;

use Test::More;
use Test::Command::Simple;

my $CMD = 'afpd';

run_ok $CMD, '-V';
like stdout, qr/^$CMD \d[\d.]*/, 'version, stdout';
like stdout, qr/AFP versions:\t1.1 2.0 2.1 2.2 3.0 3.1 3.2 3.3 3.4/, 'AFP versions';
like stdout, qr/Transport layers:\tTCP\/IP AppleTalk/, 'Transport layers';
like stdout, qr/CNID backends:\tdbd mysql sqlite/, 'CNID backends';
like stdout, qr/Default CNID backend:\tdbd/, 'Default CNID backend';
like stdout, qr/Build type:\tplain/, 'Build type';
like stdout, qr/Verbose debug:\tNo/, 'Verbose debug';
like stdout, qr{Debugging \(no ALRM/TICKLE\):\tNo}, 'Debugging (no ALRM/TICKLE)';
like stdout, qr/Zeroconf backend:\tAvahi/, 'Zeroconf backend';
like stdout, qr/TCP wrappers support:\tYes/, 'TCP wrappers support';
like stdout, qr/Quota support:\tYes/, 'Quota support';
like stdout, qr/cracklib support:\tYes/, 'cracklib support';
like stdout, qr/EA support:\tad \| sys/, 'EA support';
like stdout, qr/ACL support:\tYes/, 'ACL support';
like stdout, qr/LDAP support:\tYes/, 'LDAP support';
like stdout, qr/Spotlight search backends:\tcnid \| localsearch/, 'Spotlight search backends';
like stdout, qr/DTrace probes:\tYes/, 'DTrace probes';
like stdout, qr/FCE support:\tYes/, 'FCE support';
like stdout, qr{afp.conf:\t/etc/netatalk/afp.conf}, 'afp.conf';
like stdout, qr{extmap.conf:\t/etc/netatalk/extmap.conf}, 'extmap.conf';
like stdout, qr{state directory:\t/var/lib/netatalk/}, 'state directory';
like stdout, qr{afp_signature.conf:\t/var/lib/netatalk/afp_signature.conf}, 'afp_signature.conf';
like stdout, qr{afp_voluuid.conf:\t/var/lib/netatalk/afp_voluuid.conf}, 'afp_voluuid.conf';
like stdout, qr{UAM search path:\t/usr/lib.*/netatalk/}, 'UAM search path';
like stdout, qr{Server messages path:\t/var/lib/netatalk/msg/}, 'Server messages path';
cmp_ok stderr, 'eq', '', 'help, stderr';

done_testing;
