<commit_before>#!/usr/bin/env perl

use Test::Most tests => 8 + 5;
use Data::Dumper;

use GAT;
use GAT::Category;

our $api_base = "/categories/";

my $name       = 'Tools'; # tools gives a count of 10435 while Tools gives 10439, odd?
my $url        = $GAT::api_uri_base . $GAT::Category::api_base . lc $name;
my $things_url = $GAT::api_uri_base . $GAT::Category::api_base . lc $name . '/things';
my $count      = 10439;
my $children   = 4;

my $category = GAT::Category->new( 'name' => $name );
# print Dumper($thing);

    ok( defined $category,          'GAT::Category  object is defined' ); 
    ok( $category->isa('GAT::Category'), 'can make an GAT::Category object' ); 
can_ok( $category, qw( name ),                );
can_ok( $category, qw( count ),               );
can_ok( $category, qw( url ),                 );
can_ok( $category, qw( things_url ),          );
can_ok( $category, qw( thumbnail ),           );
can_ok( $category, qw( children ),            );
# can_ok( $category, qw( list ),              );
# can_ok( $category, qw( things ),              );

  like( $category->name,              qr($name),                      'name         accessor' ); 
    is( $category->count,             $count,                         'count        accessor' );
    is( $category->url,               $url,                           'url          accessor' ); 
    is( $category->things_url,        $things_url,                    'things_url   accessor' ); 
    is( @{$category->children},       $children,                      'children     accessor' );
#   is( @{$category->things},         $count,                         'things       accessor' );

exit 0;
__END__<commit_msg>added passing test for things organized under category<commit_after>#!/usr/bin/env perl

use Test::Most tests => 8 + 6;
use Data::Dumper;

use GAT;
use GAT::Category;

our $api_base = "/categories/";

my $name       = 'Tools'; # tools gives a count of 10435 while Tools gives 10439, odd?
my $url        = $GAT::api_uri_base . $GAT::Category::api_base . lc $name;
my $things_url = $GAT::api_uri_base . $GAT::Category::api_base . lc $name . '/things';
my $count      = 10439;
my $things     = ( $count > 30 ) ? 30 : $count;
my $children   = 4;

my $category = GAT::Category->new( 'name' => $name );
# print Dumper($thing);

    ok( defined $category,          'GAT::Category  object is defined' ); 
    ok( $category->isa('GAT::Category'), 'can make an GAT::Category object' ); 
can_ok( $category, qw( name ),                );
can_ok( $category, qw( count ),               );
can_ok( $category, qw( url ),                 );
can_ok( $category, qw( things_url ),          );
can_ok( $category, qw( thumbnail ),           );
can_ok( $category, qw( children ),            );
# can_ok( $category, qw( list ),              );
# can_ok( $category, qw( things ),              );

  like( $category->name,              qr($name),                      'name         accessor' ); 
    is( $category->count,             $count,                         'count        accessor' );
    is( $category->url,               $url,                           'url          accessor' ); 
    is( $category->things_url,        $things_url,                    'things_url   accessor' ); 
    is( @{$category->children},       $children,                      'children     accessor' );
    is( @{$category->things},         $things,                        'things       accessor' );

exit 0;
__END__
{'fraction_non_alphanumeric': 0.15360138848712757, 'fraction_numerical': 0.01214926236621348, 'mean_word_length': 1.8205546492659055, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 24, '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': '1025880', 'n_tokens_mistral': 1135, 'n_tokens_neox': 1045, 'n_words': 282}