How do I test a function or module depending on a machine or platform? For example, is something that looks / depends on $^Oor a module such as Net :: Ifconfig :: Wrapper ? I do not need to verify that Net :: Ifconfig :: Wrapper returns the correct values, but I need to check whether I am doing this correctly with these values.
Thanks!
EDIT: Testing $^Oturned out to be easier than I thought:
{
local $^O = 'linux';
$rc = GetOSType();
is($rc, $OS_LINUX, 'OS Check - linux');
}
For some reason, I thought it was a read-only variable.
source
share