When I was using Mango in my project something goes wrong when using $cursor->next in a while loop (same as it is done in de code of $cursor->all):
It seems to get all documents correctly but when $cursor->next is call at the end of the while loop after the last document, it fails with: assertion src/mongo/s/cursors.cpp:196 at /Users/user/.cpanm/work/1381491736.11366/Mango-0.14/blib/lib/Mango/Cursor.pm line 148
To verify I tried to build Mango 0.14 with ENV{TEST_ONLINE} and the tests fail at the same point. Same issue when building and testing the git master.
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/*/*.t
t/bson.t .......... ok
t/collection.t .... assertion src/mongo/s/cursors.cpp:196 at /Users/user/git/mango/blib/lib/Mango/Cursor.pm line 148
t/collection.t .... Dubious, test returned 255 (wstat 65280, 0xff00)
No subtests run
t/connection.t .... 1/? assertion src/mongo/s/cursors.cpp:196 at /Users/user/git/mango/blib/lib/Mango/Cursor.pm line 148
# Tests were run but no plan was declared and done_testing() was not seen.
t/connection.t .... Dubious, test returned 255 (wstat 65280, 0xff00)
All 23 subtests passed
t/cursor.t ........ assertion src/mongo/s/cursors.cpp:196 at /Users/user/git/mango/blib/lib/Mango/Cursor.pm line 148
t/cursor.t ........ Dubious, test returned 255 (wstat 65280, 0xff00)
No subtests run
t/database.t ...... 4/?
# Failed test 'right name'
# at t/database.t line 33.
# got: undef
# expected: 'admin'
# Failed test 'right name'
# at t/database.t line 47.
# got: undef
# expected: 'admin'
assertion src/mongo/s/cursors.cpp:196 at /Users/user/git/mango/blib/lib/Mango/Cursor.pm line 148
# Tests were run but no plan was declared and done_testing() was not seen.
t/database.t ...... Dubious, test returned 255 (wstat 65280, 0xff00)
Failed 2/6 subtests
t/gridfs.t ........ ok
t/pod.t ........... skipped: set TEST_POD to enable this test (developer only!)
t/pod_coverage.t .. skipped: set TEST_POD to enable this test (developer only!)
t/protocol.t ...... ok
Test Summary Report
-------------------
t/collection.t (Wstat: 65280 Tests: 0 Failed: 0)
Non-zero exit status: 255
Parse errors: No plan found in TAP output
t/connection.t (Wstat: 65280 Tests: 23 Failed: 0)
Non-zero exit status: 255
Parse errors: No plan found in TAP output
t/cursor.t (Wstat: 65280 Tests: 0 Failed: 0)
Non-zero exit status: 255
Parse errors: No plan found in TAP output
t/database.t (Wstat: 65280 Tests: 6 Failed: 2)
Failed tests: 4, 6
Non-zero exit status: 255
Parse errors: No plan found in TAP output
Files=9, Tests=255, 16 wallclock secs ( 0.12 usr 0.06 sys + 2.10 cusr 0.31 csys = 2.59 CPU)
Result: FAIL
Failed 4/9 test programs. 2/255 subtests failed.
make: *** [test_dynamic] Error 255