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

use strict;
use warnings;
use Test::More;
use Test::Deep;
use DDG::Test::Goodie;

zci answer_type => "sha3";
zci is_cached   => 1;

sub build_test {
    my ($text, $input, $operation) = @_;
    return test_zci($text, structured_answer => {
        data => {
            title => $text,
            subtitle => "$operation: $input"
        },
        templates => {
            group => 'text'
        }
    });
}

ddg_goodie_test(
    [qw( DDG::Goodie::SHA3 ),
    'SHA3 this string' => build_test(
        '6107e7dfa1adcff1deb313f8dfb379ee3bae01437d6e09198f556c4c81a3c24edb1b0417972a5733e585085b4296c0282fe42eb89da6a4da52005fa1395e16db',
        'this string',
        'SHA3-512 hex hash'
    ),
    'sha3 this string' => build_test(
        '6107e7dfa1adcff1deb313f8dfb379ee3bae01437d6e09198f556c4c81a3c24edb1b0417972a5733e585085b4296c0282fe42eb89da6a4da52005fa1395e16db',
        'this string',
        'SHA3-512 hex hash'
    ),
    'sha3sum this string' => build_test(
        '6107e7dfa1adcff1deb313f8dfb379ee3bae01437d6e09198f556c4c81a3c24edb1b0417972a5733e585085b4296c0282fe42eb89da6a4da52005fa1395e16db',
        'this string',
        'SHA3-512 hex hash'
    ),
    'sha3-224 this string' => build_test(<commit_msg>SHA3: Test updates and cleanup<commit_after>#!/usr/bin/env perl

use strict;
use warnings;
use Test::More;
use Test::Deep;
use DDG::Test::Goodie;

zci answer_type => "sha3";
zci is_cached   => 1;

sub build_test {
    my ($text, $input, $operation) = @_;
    return test_zci($text, structured_answer => {
        data => {
            title => $text,
            subtitle => "$operation: $input"
        },
        templates => {
            group => 'text'
        }
    });
}

ddg_goodie_test(
    [qw( DDG::Goodie::SHA3 )],
    'SHA3 this string' => build_test(
        '6107e7dfa1adcff1deb313f8dfb379ee3bae01437d6e09198f556c4c81a3c24edb1b0417972a5733e585085b4296c0282fe42eb89da6a4da52005fa1395e16db',
        'this string',
        'SHA3-512 hex hash'
    ),
    'sha3 this string' => build_test(
        '6107e7dfa1adcff1deb313f8dfb379ee3bae01437d6e09198f556c4c81a3c24edb1b0417972a5733e585085b4296c0282fe42eb89da6a4da52005fa1395e16db',
        'this string',
        'SHA3-512 hex hash'
    ),
    'sha3sum this string' => build_test(
        '6107e7dfa1adcff1deb313f8dfb379ee3bae01437d6e09198f556c4c81a3c24edb1b0417972a5733e585085b4296c0282fe42eb89da6a4da52005fa1395e16db',
        'this string',
        'SHA3-512 hex hash'
    ),
    'sha3-224 this string' => build_test(
{'fraction_non_alphanumeric': 0.10866141732283464, 'fraction_numerical': 0.20196850393700788, 'mean_word_length': 3.2705882352941176, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 27, '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': '2153816', 'n_tokens_mistral': 1320, 'n_tokens_neox': 1066, 'n_words': 149}