From 447c4cfef9077ed76b62f02811af65ee22675520 Mon Sep 17 00:00:00 2001 From: rgaul Date: Sun, 22 May 2016 19:37:26 +0000 Subject: [PATCH] Make changes per review --- lib/DDG/Goodie/Sha.pm | 2 +- t/Sha.t | 52 +++++++++++++++++++++---------------------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/lib/DDG/Goodie/Sha.pm b/lib/DDG/Goodie/Sha.pm index 25e7aafd5..dee789d87 100644 --- a/lib/DDG/Goodie/Sha.pm +++ b/lib/DDG/Goodie/Sha.pm @@ -36,7 +36,7 @@ handle query => sub { structured_answer => { data => { title => $out, - subtitle => 'SHA-' . $ver . ' ' . $enc . ' hash', + subtitle => "SHA-$ver $enc hash", }, templates => { group => 'text' diff --git a/t/Sha.t b/t/Sha.t index c2e4b7d90..57a720cf7 100644 --- a/t/Sha.t +++ b/t/Sha.t @@ -11,12 +11,12 @@ zci answer_type => 'sha'; zci is_cached => 1; sub build_structured_answer { - my ($sha, $sha_explanation) = @_; + my ($sha, $sha_version, $sha_type) = @_; return $sha, structured_answer => { data => { title => $sha, - subtitle => $sha_explanation, + subtitle => "$sha_version $sha_type hash", }, templates => { group => 'text', @@ -30,30 +30,30 @@ sub build_test { ddg_goodie_test( [qw( DDG::Goodie::Sha)], - 'shasum the duckdukcgo serach engine' => build_test('8af70bf86260fec05d7cc89e0f0be2aa3db5e5e4', 'SHA-1 hex hash'), - 'sha1sum the duckdukcgo serach engine' => build_test('8af70bf86260fec05d7cc89e0f0be2aa3db5e5e4', 'SHA-1 hex hash'), - 'sha-1 the duckdukcgo serach engine' => build_test('8af70bf86260fec05d7cc89e0f0be2aa3db5e5e4', 'SHA-1 hex hash'), - 'sha256sum base64 the duckdukcgo serach engine' => build_test('XUKkFU44G21/OPBB47hIwC3Q1lb1Cl8ktI2GjyCDFrM=', 'SHA-256 base64 hash'), - 'sha-256 base64 the duckdukcgo serach engine' => build_test('XUKkFU44G21/OPBB47hIwC3Q1lb1Cl8ktI2GjyCDFrM=', 'SHA-256 base64 hash'), - 'sha-1 base64 lorem ipsum' => build_test('v7d1mmfa62VBBJC02Yu52n0eos4=', 'SHA-1 base64 hash'), - 'sha-224 base64 lorem ipsum' => build_test('4ZHt8GAFcSWDUYztkswqwvrI1uRiOwIaUHNqkQ==', 'SHA-224 base64 hash'), - 'sha-256 base64 lorem ipsum' => build_test('Xiv1fT9AxLbfadrxk2y3ZvgyN0tPwCWafL/wbi9w8mk=', 'SHA-256 base64 hash'), - 'sha-384 base64 lorem ipsum' => build_test('WXSTps8SiXV1JOVN/W9oszLHIUpxajNYkR71wJkHrcimVKGMHXIeGDsAJfmW9uJG', 'SHA-384 base64 hash'), - 'sha-512 base64 lorem ipsum' => build_test('+A7r2aq7GhX7hp7VaNhYpcDco9XaB6QQ4b2Yh2ORjZc+NEgUYl98hEaVst42/9J68pDQ40NixR3uWUfVjUBSeg==', 'SHA-512 base64 hash'), - 'shasum hex this' => build_test('c2543fff3bfa6f144c2f06a7de6cd10c0b650cae', 'SHA-1 hex hash'), - 'sha224sum base64 this' => build_test('kFct0af7OnZ8E66tO0CmyDv1uXW7nSRHon3JYg==', 'SHA-224 base64 hash'), - 'sha1sum "this"' => build_test('c2543fff3bfa6f144c2f06a7de6cd10c0b650cae', 'SHA-1 hex hash'), - 'sha "this' => build_test('e1ea2c30284aa81804b52c034c997b06c5d7d4d9', 'SHA-1 hex hash'), - 'sha this"' => build_test('2d9d48e524574ae527fbd5e55ea2e7dcba84d4f9', 'SHA-1 hex hash'), - 'sha "this and "that""' => build_test('aa6b22799b19374a5d01f07167fd0f3bea897bd0', 'SHA-1 hex hash'), - 'sha hash of "this and that"' => build_test('4f813651453b11db74cbc36ccddea13f109e8412', 'SHA-1 hex hash'), - 'sha hash of this and that' => build_test('4f813651453b11db74cbc36ccddea13f109e8412', 'SHA-1 hex hash'), - 'sha hash this and that' => build_test('4f813651453b11db74cbc36ccddea13f109e8412', 'SHA-1 hex hash'), - 'sha256 base64 hash of "this and that"' => build_test('6GPBrEJhmitCmgh3WmrNif9MLGuNrhLjRhpfpjsvkvU=', 'SHA-256 base64 hash'), - 'shasum