{"action":"created","comment":{"url":"https://api.github.com/repos/ardavey/Intermediate-Perl/pulls/comments/40886413","id":40886413,"diff_hunk":"@@ -0,0 +1,227 @@\n+package Test::My::List::Util;\n+\n+use 5.006;\n+use strict;\n+use warnings;\n+\n+use Exporter qw(import);\n+use vars qw(@EXPORT $VERSION);\n+\n+use Test::Builder;\n+\n+my $Test = new Test::Builder();\n+\n+$VERSION = '3.14';\n+@EXPORT  = qw(sum_ok);\n+\n+=head1 NAME\n+\n+Test::My::List::Util - Test utility module for My::List::Util\n+\n+=head1 VERSION\n+\n+Version 0.01\n+\n+=cut\n+\n+our $VERSION = '0.01';\n+\n+=head1 SYNOPSIS\n+\n+Helps with testing My::List::Util\n+\n+=head1 EXPORT\n+\n+A list of functions that can be exported.  You can delete this section\n+if you dont export anything, such as for a purely object-oriented module.\n+\n+=head1 SUBROUTINES/METHODS\n+\n+=head2 sum_ok\n+\n+checks that a list can sum correctly.\n+\n+    sum_ok( $actual, $expected );\n+    sum_ok( $actual, $expected, \"The sums don't match!\" );\n+\n+=cut\n+\n+sub sum_ok {\n+  my ( $actual, $expected, $message ) = @_;\n+\n+  if ( !defined $actual && !defined $expected ) {\n+    $Test->ok( 1, $message );\n+    return 1;\n+  }\n+  elsif ( !defined $actual ) {\n+    $Test->diag( \"Actual value was not defined, expected [$expected]!\\n\" );\n+    $Test->ok( 0, $message );\n+    return 0;\n+  }\n+  elsif ( !defined $expected ) {\n+    $Test->diag( \"Actual value was [$actual], expected undefined!\\n\" );\n+    $Test->ok( 0, $message );\n+    return 0;\n+  }\n+  else {\n+    # We have two defined values now.\n+    # Lets see if they're both scalars\n+    my $actual_ref   = ref $actual;\n+    my $expected_ref = ref $expected;\n+\n+    if ( $actual_ref && $expected_ref ) {\n+\n+      # we have two references for some reason....\n+      if ( $actual_ref eq $expected_ref ) {\n+\n+        # They're both the same type of reference, so lets just say they're the same.\n+        $Test->diag( \"Returning ok for two matching reference types - [$actual_ref]!\\n\" );\n+        $Test->ok( 1, $message );\n+        return 1;","path":"mssw/My-List-Util/lib/Test/My/List/Util.pm","position":80,"original_position":80,"commit_id":"6275001d48a040f001c5071acb708b7c8f5eeace","original_commit_id":"6275001d48a040f001c5071acb708b7c8f5eeace","user":{"login":"Utopia1138","id":2646781,"avatar_url":"https://avatars.githubusercontent.com/u/2646781?v=3","gravatar_id":"","url":"https://api.github.com/users/Utopia1138","html_url":"https://github.com/Utopia1138","followers_url":"https://api.github.com/users/Utopia1138/followers","following_url":"https://api.github.com/users/Utopia1138/following{/other_user}","gists_url":"https://api.github.com/users/Utopia1138/gists{/gist_id}","starred_url":"https://api.github.com/users/Utopia1138/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Utopia1138/subscriptions","organizations_url":"https://api.github.com/users/Utopia1138/orgs","repos_url":"https://api.github.com/users/Utopia1138/repos","events_url":"https://api.github.com/users/Utopia1138/events{/privacy}","received_events_url":"https://api.github.com/users/Utopia1138/received_events","type":"User","site_admin":false},"body":"But this test function wants numeric sums, not refs. Also you could pass in two hashrefs with differing contents and pass this test.","created_at":"2015-10-01T07:44:09Z","updated_at":"2015-10-01T07:44:09Z","html_url":"https://github.com/ardavey/Intermediate-Perl/pull/137#discussion_r40886413","pull_request_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/pulls/137","_links":{"self":{"href":"https://api.github.com/repos/ardavey/Intermediate-Perl/pulls/comments/40886413"},"html":{"href":"https://github.com/ardavey/Intermediate-Perl/pull/137#discussion_r40886413"},"pull_request":{"href":"https://api.github.com/repos/ardavey/Intermediate-Perl/pulls/137"}}},"pull_request":{"url":"https://api.github.com/repos/ardavey/Intermediate-Perl/pulls/137","id":46286164,"html_url":"https://github.com/ardavey/Intermediate-Perl/pull/137","diff_url":"https://github.com/ardavey/Intermediate-Perl/pull/137.diff","patch_url":"https://github.com/ardavey/Intermediate-Perl/pull/137.patch","issue_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/issues/137","number":137,"state":"open","locked":false,"title":"Mssw chapter20","user":{"login":"Spinodal","id":2004473,"avatar_url":"https://avatars.githubusercontent.com/u/2004473?v=3","gravatar_id":"","url":"https://api.github.com/users/Spinodal","html_url":"https://github.com/Spinodal","followers_url":"https://api.github.com/users/Spinodal/followers","following_url":"https://api.github.com/users/Spinodal/following{/other_user}","gists_url":"https://api.github.com/users/Spinodal/gists{/gist_id}","starred_url":"https://api.github.com/users/Spinodal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Spinodal/subscriptions","organizations_url":"https://api.github.com/users/Spinodal/orgs","repos_url":"https://api.github.com/users/Spinodal/repos","events_url":"https://api.github.com/users/Spinodal/events{/privacy}","received_events_url":"https://api.github.com/users/Spinodal/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-09-29T14:42:09Z","updated_at":"2015-10-01T07:44:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f4e4c4f37dab6fe95ee3a0f8c6843c14a6f8f37a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/pulls/137/commits","review_comments_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/pulls/137/comments","review_comment_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/issues/137/comments","statuses_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/statuses/6275001d48a040f001c5071acb708b7c8f5eeace","head":{"label":"ardavey:mssw_chapter20","ref":"mssw_chapter20","sha":"6275001d48a040f001c5071acb708b7c8f5eeace","user":{"login":"ardavey","id":2790047,"avatar_url":"https://avatars.githubusercontent.com/u/2790047?v=3","gravatar_id":"","url":"https://api.github.com/users/ardavey","html_url":"https://github.com/ardavey","followers_url":"https://api.github.com/users/ardavey/followers","following_url":"https://api.github.com/users/ardavey/following{/other_user}","gists_url":"https://api.github.com/users/ardavey/gists{/gist_id}","starred_url":"https://api.github.com/users/ardavey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ardavey/subscriptions","organizations_url":"https://api.github.com/users/ardavey/orgs","repos_url":"https://api.github.com/users/ardavey/repos","events_url":"https://api.github.com/users/ardavey/events{/privacy}","received_events_url":"https://api.github.com/users/ardavey/received_events","type":"User","site_admin":false},"repo":{"id":26066281,"name":"Intermediate-Perl","full_name":"ardavey/Intermediate-Perl","owner":{"login":"ardavey","id":2790047,"avatar_url":"https://avatars.githubusercontent.com/u/2790047?v=3","gravatar_id":"","url":"https://api.github.com/users/ardavey","html_url":"https://github.com/ardavey","followers_url":"https://api.github.com/users/ardavey/followers","following_url":"https://api.github.com/users/ardavey/following{/other_user}","gists_url":"https://api.github.com/users/ardavey/gists{/gist_id}","starred_url":"https://api.github.com/users/ardavey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ardavey/subscriptions","organizations_url":"https://api.github.com/users/ardavey/orgs","repos_url":"https://api.github.com/users/ardavey/repos","events_url":"https://api.github.com/users/ardavey/events{/privacy}","received_events_url":"https://api.github.com/users/ardavey/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ardavey/Intermediate-Perl","description":"Exercise solutions from the O'Reilly book of the same name.","fork":false,"url":"https://api.github.com/repos/ardavey/Intermediate-Perl","forks_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/forks","keys_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/teams","hooks_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/hooks","issue_events_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/issues/events{/number}","events_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/events","assignees_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/assignees{/user}","branches_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/branches{/branch}","tags_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/tags","blobs_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/git/refs{/sha}","trees_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/statuses/{sha}","languages_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/languages","stargazers_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/stargazers","contributors_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/contributors","subscribers_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/subscribers","subscription_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/subscription","commits_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/commits{/sha}","git_commits_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/git/commits{/sha}","comments_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/comments{/number}","issue_comment_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/issues/comments{/number}","contents_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/contents/{+path}","compare_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/merges","archive_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/downloads","issues_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/issues{/number}","pulls_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/pulls{/number}","milestones_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/milestones{/number}","notifications_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/labels{/name}","releases_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/releases{/id}","created_at":"2014-11-01T23:27:01Z","updated_at":"2015-05-22T09:48:20Z","pushed_at":"2015-09-30T18:49:06Z","git_url":"git://github.com/ardavey/Intermediate-Perl.git","ssh_url":"git@github.com:ardavey/Intermediate-Perl.git","clone_url":"https://github.com/ardavey/Intermediate-Perl.git","svn_url":"https://github.com/ardavey/Intermediate-Perl","homepage":null,"size":5339,"stargazers_count":0,"watchers_count":0,"language":"Perl","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"ardavey:master","ref":"master","sha":"8a0585c141c40e8fc1f7989e2a54fe4fa80aba85","user":{"login":"ardavey","id":2790047,"avatar_url":"https://avatars.githubusercontent.com/u/2790047?v=3","gravatar_id":"","url":"https://api.github.com/users/ardavey","html_url":"https://github.com/ardavey","followers_url":"https://api.github.com/users/ardavey/followers","following_url":"https://api.github.com/users/ardavey/following{/other_user}","gists_url":"https://api.github.com/users/ardavey/gists{/gist_id}","starred_url":"https://api.github.com/users/ardavey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ardavey/subscriptions","organizations_url":"https://api.github.com/users/ardavey/orgs","repos_url":"https://api.github.com/users/ardavey/repos","events_url":"https://api.github.com/users/ardavey/events{/privacy}","received_events_url":"https://api.github.com/users/ardavey/received_events","type":"User","site_admin":false},"repo":{"id":26066281,"name":"Intermediate-Perl","full_name":"ardavey/Intermediate-Perl","owner":{"login":"ardavey","id":2790047,"avatar_url":"https://avatars.githubusercontent.com/u/2790047?v=3","gravatar_id":"","url":"https://api.github.com/users/ardavey","html_url":"https://github.com/ardavey","followers_url":"https://api.github.com/users/ardavey/followers","following_url":"https://api.github.com/users/ardavey/following{/other_user}","gists_url":"https://api.github.com/users/ardavey/gists{/gist_id}","starred_url":"https://api.github.com/users/ardavey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ardavey/subscriptions","organizations_url":"https://api.github.com/users/ardavey/orgs","repos_url":"https://api.github.com/users/ardavey/repos","events_url":"https://api.github.com/users/ardavey/events{/privacy}","received_events_url":"https://api.github.com/users/ardavey/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ardavey/Intermediate-Perl","description":"Exercise solutions from the O'Reilly book of the same name.","fork":false,"url":"https://api.github.com/repos/ardavey/Intermediate-Perl","forks_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/forks","keys_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/teams","hooks_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/hooks","issue_events_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/issues/events{/number}","events_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/events","assignees_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/assignees{/user}","branches_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/branches{/branch}","tags_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/tags","blobs_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/git/refs{/sha}","trees_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/statuses/{sha}","languages_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/languages","stargazers_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/stargazers","contributors_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/contributors","subscribers_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/subscribers","subscription_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/subscription","commits_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/commits{/sha}","git_commits_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/git/commits{/sha}","comments_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/comments{/number}","issue_comment_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/issues/comments{/number}","contents_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/contents/{+path}","compare_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/merges","archive_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/downloads","issues_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/issues{/number}","pulls_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/pulls{/number}","milestones_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/milestones{/number}","notifications_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/labels{/name}","releases_url":"https://api.github.com/repos/ardavey/Intermediate-Perl/releases{/id}","created_at":"2014-11-01T23:27:01Z","updated_at":"2015-05-22T09:48:20Z","pushed_at":"2015-09-30T18:49:06Z","git_url":"git://github.com/ardavey/Intermediate-Perl.git","ssh_url":"git@github.com:ardavey/Intermediate-Perl.git","clone_url":"https://github.com/ardavey/Intermediate-Perl.git","svn_url":"https://github.com/ardavey/Intermediate-Perl","homepage":null,"size":5339,"stargazers_count":0,"watchers_count":0,"language":"Perl","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ardavey/Intermediate-Perl/pulls/137"},"html":{"href":"https://github.com/ardavey/Intermediate-Perl/pull/137"},"issue":{"href":"https://api.github.com/repos/ardavey/Intermediate-Perl/issues/137"},"comments":{"href":"https://api.github.com/repos/ardavey/Intermediate-Perl/issues/137/comments"},"review_comments":{"href":"https://api.github.com/repos/ardavey/Intermediate-Perl/pulls/137/comments"},"review_comment":{"href":"https://api.github.com/repos/ardavey/Intermediate-Perl/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ardavey/Intermediate-Perl/pulls/137/commits"},"statuses":{"href":"https://api.github.com/repos/ardavey/Intermediate-Perl/statuses/6275001d48a040f001c5071acb708b7c8f5eeace"}}}}