Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue in is_deeply test in t/dumptruck.t in situation when dump() returns things like JSON::PP::Boolean #2

Open
michal-josef-spacek opened this issue Sep 2, 2022 · 3 comments

Comments

@michal-josef-spacek
Copy link

Affected test:

is_deeply ($dt3->dump, [{
        name => 'Behemoth',
        age => 666,
        yes => !!1,
        wide => 'Pišišvorík',
        foo => undef,
        random => {
                name => 'Behemoth',
                age => 666,
                yes => !!1,
                wide => 'Pišišvorík',
                foo => undef,
        },
}], 'Proper data was retrieved from the database');

Structure for 'random' key is JSON string which si decoded by decode_json() to dump(). If in this structure come JSON::PP::Boolean (in yes), comparison is_deeply() isn't working.

@michal-josef-spacek
Copy link
Author

Example fail in Fedora builiding system:

+ ./Build test
#   Failed test 'Proper data was retrieved from the database'
#   at t/dumptruck.t line 189.
#     Structures begin differing at:
#          $got->[0]{random}{yes} = 1
#     $expected->[0]{random}{yes} = '1'
# Looks like you failed 1 test of 43.
t/dumptruck.t ..

@michal-josef-spacek
Copy link
Author

Structure from dump() in test case is (printed by Data::Printer::p):

[
    [0] {
            age      666,
            foo      undef,
            name     "Behemoth",
            random   {
                age    666,
                foo    undef,
                name   "Behemoth",
                wide   "Pišišvorík",
                yes    1 (JSON::PP::Boolean)
            },
            wide     "Pišišvorík",
            yes      1
        }
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant