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