<commit_before>use strict;
use warnings;
use Test::More tests => 10;
use Test::Exception;

use MongoDB;

my $conn = MongoDB::Connection->new;
isa_ok($conn, 'MongoDB::Connection');

my $db = $conn->get_database('test_database');
isa_ok($db, 'MongoDB::Database');

$db->drop;

is(scalar $db->collection_names, 0, 'no collections');
my $coll = $db->get_collection('test');
is($coll->count, 0, 'collection is empty');

# TODO enable once fixed
# is($coll->find_one, undef, 'nothing for find_one');

my $id = $coll->insert({ just => 'another', perl => 'hacker' });<commit_msg>Enable test for find_one returning undef if nothing is found.<commit_after>use strict;
use warnings;
use Test::More tests => 11;
use Test::Exception;

use MongoDB;

my $conn = MongoDB::Connection->new;
isa_ok($conn, 'MongoDB::Connection');

my $db = $conn->get_database('test_database');
isa_ok($db, 'MongoDB::Database');

$db->drop;

is(scalar $db->collection_names, 0, 'no collections');
my $coll = $db->get_collection('test');
is($coll->count, 0, 'collection is empty');

is($coll->find_one, undef, 'nothing for find_one');

my $id = $coll->insert({ just => 'another', perl => 'hacker' });
{'fraction_non_alphanumeric': 0.1951848667239897, 'fraction_numerical': 0.006878761822871883, 'mean_word_length': 6.414012738853503, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5848224', 'n_tokens_mistral': 418, 'n_tokens_neox': 398, 'n_words': 109}