summaryrefslogtreecommitdiff
path: root/cpan/Win32/t/CodePage.t
diff options
context:
space:
mode:
Diffstat (limited to 'cpan/Win32/t/CodePage.t')
-rw-r--r--cpan/Win32/t/CodePage.t27
1 files changed, 27 insertions, 0 deletions
diff --git a/cpan/Win32/t/CodePage.t b/cpan/Win32/t/CodePage.t
new file mode 100644
index 0000000000..75741cc974
--- /dev/null
+++ b/cpan/Win32/t/CodePage.t
@@ -0,0 +1,27 @@
+use strict;
+use Test;
+use Win32;
+
+plan tests => 8;
+
+my $ansicp = Win32::GetACP();
+ok($ansicp > 0 && $ansicp <= 65001);
+
+my $inputcp = Win32::GetConsoleCP();
+ok($inputcp > 0 && $inputcp <= 65001);
+
+my $outputcp = Win32::GetConsoleOutputCP();
+ok($outputcp > 0 && $outputcp <= 65001);
+
+my $oemcp = Win32::GetOEMCP();
+ok($oemcp > 0 && $oemcp <= 65001);
+
+ok(Win32::SetConsoleCP($ansicp));
+ok(Win32::GetConsoleCP() == $ansicp);
+
+ok(Win32::SetConsoleOutputCP($ansicp));
+ok(Win32::GetConsoleOutputCP() == $ansicp);
+
+# Reset things when we're done.
+Win32::SetConsoleCP($inputcp);
+Win32::SetConsoleOutputCP($outputcp);