5 print "1..0 # Skip: Test requires Test::More module\n";
11 $tests += 2 if Win32::IsWinNT();
15 # test Win32::DomainName()
16 if (Win32::IsWinNT()) {
17 my $domain = eval { Win32::DomainName() };
18 is( $@, '', "Win32::DomainName()" );
19 like( $domain, '/^[a-zA-Z0-9!@#$%^&()_\'{}.~-]+$/', " - checking returned domain" );
22 # test Win32::GetArchName()
23 my $archname = eval { Win32::GetArchName() };
24 is( $@, '', "Win32::GetArchName()" );
25 cmp_ok( length($archname), '>=', 3, " - checking returned architecture name" );
27 # test Win32::GetChipName()
28 my $chipname = eval { Win32::GetChipName() };
29 is( $@, '', "Win32::GetChipName()" );
30 cmp_ok( length($chipname), '>=', 3, " - checking returned chip name" );
32 # test Win32::GetOSName()
34 my $osname = eval { Win32::GetOSName() };
35 is( $@, '', "Win32::GetOSName() in scalar context" );
36 cmp_ok( length($osname), '>', 3, " - checking returned OS name" );
39 my ($osname2, $desc) = eval { Win32::GetOSName() };
40 is( $@, '', "Win32::GetOSName() in list context" );
41 cmp_ok( length($osname), '>', 3, " - checking returned OS name" );
42 cmp_ok( length($desc ), '>', 3, " - checking returned description" );
43 is( $osname2, $osname, " - checking that OS name is the same in both calls" );
45 # test Win32::LoginName()
46 my $login = eval { Win32::LoginName() };
47 is( $@, '', "Win32::LoginName()" );
48 cmp_ok( length($login), '>', 1, " - checking returned login name" );
50 # test Win32::NodeName()
51 my $nodename = eval { Win32::NodeName() };
52 is( $@, '', "Win32::NodeName()" );
53 cmp_ok( length($nodename), '>', 1, " - checking returned node name" );