Upstream proxmox-git/pve-common state of the touched files before c9126f73ae
This commit is contained in:
1 parent
dccc97a0ea
commit
927e892d87
2 files changed
+2928
-16
No files matched your search
File diff suppressed because it is too large.
Load diff
@@ -7,7 +7,6 @@ use lib '../src';
|
||||
use PVE::JSONSchema;
|
||||
use PVE::CLIFormatter;
|
||||
|
||||
use Encode qw(decode);
|
||||
use Test::More;
|
||||
use Test::MockModule;
|
||||
|
||||
@@ -45,7 +44,6 @@ my $render_data = [
|
||||
["bytes", 1024, undef, "1.00 KiB"],
|
||||
["bytes", 1024 * 1024 * 123 + 1024 * 300, 1, "123.3 MiB"],
|
||||
["bytes", 1024 * 1024 * 1024 * 1024 * 4 + 1024 * 1024 * 2048 * 8, undef, "4.02 TiB"],
|
||||
["yaml", { description => "Erkl\x{e4}rung" }, undef, "description: Erkl\x{e4}rung\n"],
|
||||
];
|
||||
|
||||
foreach my $data (@$render_data) {
|
||||
@@ -55,18 +53,4 @@ foreach my $data (@$render_data) {
|
||||
is($actual, $expected, "string format '$renderer_name'");
|
||||
}
|
||||
|
||||
# test that non-ASCII characters survive the structured output formats
|
||||
my $unicode_data = { description => "Erkl\x{e4}rung" };
|
||||
for my $format (qw(json yaml)) {
|
||||
open(my $fh, '>', \my $output) or die "failed to open in-memory file - $!\n";
|
||||
my $stdout = select($fh);
|
||||
PVE::CLIFormatter::print_api_result(
|
||||
$unicode_data, undef, undef, { 'output-format' => $format }, {},
|
||||
);
|
||||
select($stdout);
|
||||
close($fh);
|
||||
|
||||
like(decode('UTF-8', $output), qr/Erkl\x{e4}rung/, "output format '$format' is UTF-8 encoded");
|
||||
}
|
||||
|
||||
done_testing();
|
||||
Reference in new issue
Block a user