Skip to content

Commit

Permalink
Issue #2462: add a couple of test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
bschmalhofer committed Aug 15, 2023
1 parent fe97d57 commit 8d10759
Showing 1 changed file with 37 additions and 1 deletion.
38 changes: 37 additions & 1 deletion scripts/test/YAML/YAML.t
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ use utf8;
# CPAN modules
use Test2::V0;
use YAML::XS qw();
use Try::Tiny;

# OTOBO modules
use Kernel::System::UnitTest::RegisterOM; # set up $Kernel::OM
Expand Down Expand Up @@ -137,13 +138,25 @@ my @Tests = (
SuccessDecode => 1,
},

{
Name => 'Simple String 0 - roundtrip',
Data => '0',
SuccessDecode => 1,
},
{
Name => 'Simple String 0',
YAMLString => "---\n'0'\n",
Data => '0',
SuccessDecode => 1,
},
{
Name => 'Number 0 - roundtrip',
Data => 0,
SuccessDecode => 1,
},
{
Name => 'Number 0',
YAMLString => "---\n0\n",
Data => 0,
SuccessDecode => 1,
},
Expand All @@ -168,10 +181,33 @@ my @Tests = (
SuccessDecode => 1,
},
{
Name => 'Simple Empty String',
Name => 'Empty String - roundtrip',
Data => '',
SuccessDecode => 1,
},
{
Name => 'Empty String',
YAMLString => "---\n''\n",
Data => '',
SuccessDecode => 1,
},
{
Name => 'undef - roundtrip',
Data => undef,
SuccessDecode => 1,
},
{
Name => 'null',
YAMLString => "---\nnull\n",
Data => undef,
SuccessDecode => 1,
},
{
Name => 'tilde',
YAMLString => "---\n~\n",
Data => undef,
SuccessDecode => 1,
},
{
Name => 'Complex Structure with 0',
Data => {
Expand Down

0 comments on commit 8d10759

Please sign in to comment.