Actually note that Shell.pm is deprecated for 5.13 and 5.14, so we can
[p5sagit/p5-mst-13.2.git] / cpan / Win32 / t / GetOSName.t
CommitLineData
8883bb5a 1use strict;\r
2use Test;\r
3use Win32;\r
4\r
5my @tests = (\r
6 # $id, $major, $minor, $pt, $build, $tag\r
7 [ "WinWin32s", 0 ],\r
8 [ "Win95", 1, 4, 0 ],\r
9 [ "Win95", 1, 4, 0, 0, 67109814, "(a)" ],\r
10 [ "Win95", 1, 4, 0, 0, 67306684, "(b1)" ],\r
11 [ "Win95", 1, 4, 0, 0, 67109975, "(b2)" ],\r
12 [ "Win98", 1, 4, 10 ],\r
13 [ "Win98", 1, 4, 10, 0, 67766446, "(2nd ed)" ],\r
14 [ "WinMe", 1, 4, 90 ],\r
15 [ "WinNT3.51", 2, 3, 51 ],\r
16 [ "WinNT4", 2, 4, 0 ],\r
17 [ "Win2000", 2, 5, 0 ],\r
18 [ "WinXP/.Net", 2, 5, 1 ],\r
19 [ "Win2003", 2, 5, 2 ],\r
20 [ "WinVista", 2, 6, 0, 1 ],\r
21 [ "Win2008", 2, 6, 0, 2 ],\r
22 [ "Win7", 2, 6, 1 ],\r
23);\r
24\r
25plan tests => 2*scalar(@tests) + 1;\r
26\r
27# Test internal implementation function\r
28for my $test (@tests) {\r
29 my($expect, $id, $major, $minor, $pt, $build, $tag) = @$test;\r
30 my($os, $desc) = Win32::_GetOSName("", $major, $minor, $build||0, $id, $pt);\r
31 ok($os, $expect);\r
32 ok($desc, $tag||"");\r
33}\r
34\r
35# Does Win32::GetOSName() return the correct value for the current OS?\r
36my(undef, $major, $minor, $build, $id, undef, undef, undef, $pt)\r
37 = Win32::GetOSVersion();\r
38my($os, $desc) = Win32::_GetOSName("", $major, $minor, $build, $id, $pt);\r
39ok(scalar Win32::GetOSName(), $os);\r