{"action":"created","comment":{"url":"https://api.github.com/repos/jbeder/yaml-cpp/pulls/comments/51363917","id":51363917,"diff_hunk":"@@ -0,0 +1,186 @@\n+#include \"gtest/gtest.h\"\n+#include \"regex_yaml.h\"\n+#include \"stream.h\"\n+\n+using YAML::RegEx;\n+using YAML::Stream;\n+\n+namespace {\n+TEST(RegExTest, Empty) {\n+  RegEx empty;\n+  EXPECT_TRUE(empty.Matches(std::string()));\n+  EXPECT_EQ(0, empty.Match(std::string()));\n+  for (int ii = Stream::eof() + 1; ii < 128; ++ii) {\n+    EXPECT_FALSE(empty.Matches(char(ii)));\n+    EXPECT_EQ(-1, empty.Match(char(ii)));\n+  }\n+}\n+\n+TEST(RegExTest, SingleCharacter) {\n+  for (int ii = Stream::eof() + 1; ii < 128; ++ii) {\n+    RegEx ex((char)ii);\n+    for (int jj = Stream::eof() + 1; jj < 128; ++jj) {\n+      if (jj == ii) {\n+        EXPECT_TRUE(ex.Matches(char(jj)));\n+        EXPECT_EQ(1, ex.Match(char(jj)));\n+\n+        // Match at start of string only!\n+        std::string prefixed = std::string(1, ii + 1) +\n+                               std::string(\"prefix: \") +\n+                               std::string(1, char(jj));\n+        EXPECT_FALSE(ex.Matches(prefixed));\n+        EXPECT_EQ(-1, ex.Match(prefixed));\n+      } else {\n+        EXPECT_FALSE(ex.Matches(char(jj)));\n+        EXPECT_EQ(-1, ex.Match(char(jj)));\n+      }\n+    }\n+  }\n+}\n+\n+TEST(RegExTest, Range) {\n+  for (int ii = Stream::eof() + 1; ii < 127; ++ii) {","path":"test/regex_test.cpp","position":42,"original_position":42,"commit_id":"82b4e0dc2802164041c2d1194cf1d42ad26d284a","original_commit_id":"82b4e0dc2802164041c2d1194cf1d42ad26d284a","user":{"login":"jbeder","id":1059334,"avatar_url":"https://avatars.githubusercontent.com/u/1059334?v=3","gravatar_id":"","url":"https://api.github.com/users/jbeder","html_url":"https://github.com/jbeder","followers_url":"https://api.github.com/users/jbeder/followers","following_url":"https://api.github.com/users/jbeder/following{/other_user}","gists_url":"https://api.github.com/users/jbeder/gists{/gist_id}","starred_url":"https://api.github.com/users/jbeder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbeder/subscriptions","organizations_url":"https://api.github.com/users/jbeder/orgs","repos_url":"https://api.github.com/users/jbeder/repos","events_url":"https://api.github.com/users/jbeder/events{/privacy}","received_events_url":"https://api.github.com/users/jbeder/received_events","type":"User","site_admin":false},"body":"Do you mean to ensure that ii < jj? If so, just make the second loop go from ii + 1 to 128.","created_at":"2016-01-31T17:21:46Z","updated_at":"2016-01-31T17:21:46Z","html_url":"https://github.com/jbeder/yaml-cpp/pull/356#discussion_r51363917","pull_request_url":"https://api.github.com/repos/jbeder/yaml-cpp/pulls/356","_links":{"self":{"href":"https://api.github.com/repos/jbeder/yaml-cpp/pulls/comments/51363917"},"html":{"href":"https://github.com/jbeder/yaml-cpp/pull/356#discussion_r51363917"},"pull_request":{"href":"https://api.github.com/repos/jbeder/yaml-cpp/pulls/356"}}},"pull_request":{"url":"https://api.github.com/repos/jbeder/yaml-cpp/pulls/356","id":55942030,"html_url":"https://github.com/jbeder/yaml-cpp/pull/356","diff_url":"https://github.com/jbeder/yaml-cpp/pull/356.diff","patch_url":"https://github.com/jbeder/yaml-cpp/pull/356.patch","issue_url":"https://api.github.com/repos/jbeder/yaml-cpp/issues/356","number":356,"state":"open","locked":false,"title":"add some tests for RegEx","user":{"login":"swolchok","id":34168,"avatar_url":"https://avatars.githubusercontent.com/u/34168?v=3","gravatar_id":"","url":"https://api.github.com/users/swolchok","html_url":"https://github.com/swolchok","followers_url":"https://api.github.com/users/swolchok/followers","following_url":"https://api.github.com/users/swolchok/following{/other_user}","gists_url":"https://api.github.com/users/swolchok/gists{/gist_id}","starred_url":"https://api.github.com/users/swolchok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swolchok/subscriptions","organizations_url":"https://api.github.com/users/swolchok/orgs","repos_url":"https://api.github.com/users/swolchok/repos","events_url":"https://api.github.com/users/swolchok/events{/privacy}","received_events_url":"https://api.github.com/users/swolchok/received_events","type":"User","site_admin":false},"body":"Just some unit tests to catch regressions.","created_at":"2016-01-13T19:16:12Z","updated_at":"2016-01-31T17:21:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0c6948d1da6420c35646327cca93cceb9557ea16","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jbeder/yaml-cpp/pulls/356/commits","review_comments_url":"https://api.github.com/repos/jbeder/yaml-cpp/pulls/356/comments","review_comment_url":"https://api.github.com/repos/jbeder/yaml-cpp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jbeder/yaml-cpp/issues/356/comments","statuses_url":"https://api.github.com/repos/jbeder/yaml-cpp/statuses/82b4e0dc2802164041c2d1194cf1d42ad26d284a","head":{"label":"swolchok:regex-tests","ref":"regex-tests","sha":"82b4e0dc2802164041c2d1194cf1d42ad26d284a","user":{"login":"swolchok","id":34168,"avatar_url":"https://avatars.githubusercontent.com/u/34168?v=3","gravatar_id":"","url":"https://api.github.com/users/swolchok","html_url":"https://github.com/swolchok","followers_url":"https://api.github.com/users/swolchok/followers","following_url":"https://api.github.com/users/swolchok/following{/other_user}","gists_url":"https://api.github.com/users/swolchok/gists{/gist_id}","starred_url":"https://api.github.com/users/swolchok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swolchok/subscriptions","organizations_url":"https://api.github.com/users/swolchok/orgs","repos_url":"https://api.github.com/users/swolchok/repos","events_url":"https://api.github.com/users/swolchok/events{/privacy}","received_events_url":"https://api.github.com/users/swolchok/received_events","type":"User","site_admin":false},"repo":{"id":49535432,"name":"yaml-cpp","full_name":"swolchok/yaml-cpp","owner":{"login":"swolchok","id":34168,"avatar_url":"https://avatars.githubusercontent.com/u/34168?v=3","gravatar_id":"","url":"https://api.github.com/users/swolchok","html_url":"https://github.com/swolchok","followers_url":"https://api.github.com/users/swolchok/followers","following_url":"https://api.github.com/users/swolchok/following{/other_user}","gists_url":"https://api.github.com/users/swolchok/gists{/gist_id}","starred_url":"https://api.github.com/users/swolchok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swolchok/subscriptions","organizations_url":"https://api.github.com/users/swolchok/orgs","repos_url":"https://api.github.com/users/swolchok/repos","events_url":"https://api.github.com/users/swolchok/events{/privacy}","received_events_url":"https://api.github.com/users/swolchok/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/swolchok/yaml-cpp","description":"A YAML parser and emitter in C++","fork":true,"url":"https://api.github.com/repos/swolchok/yaml-cpp","forks_url":"https://api.github.com/repos/swolchok/yaml-cpp/forks","keys_url":"https://api.github.com/repos/swolchok/yaml-cpp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/swolchok/yaml-cpp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/swolchok/yaml-cpp/teams","hooks_url":"https://api.github.com/repos/swolchok/yaml-cpp/hooks","issue_events_url":"https://api.github.com/repos/swolchok/yaml-cpp/issues/events{/number}","events_url":"https://api.github.com/repos/swolchok/yaml-cpp/events","assignees_url":"https://api.github.com/repos/swolchok/yaml-cpp/assignees{/user}","branches_url":"https://api.github.com/repos/swolchok/yaml-cpp/branches{/branch}","tags_url":"https://api.github.com/repos/swolchok/yaml-cpp/tags","blobs_url":"https://api.github.com/repos/swolchok/yaml-cpp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/swolchok/yaml-cpp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/swolchok/yaml-cpp/git/refs{/sha}","trees_url":"https://api.github.com/repos/swolchok/yaml-cpp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/swolchok/yaml-cpp/statuses/{sha}","languages_url":"https://api.github.com/repos/swolchok/yaml-cpp/languages","stargazers_url":"https://api.github.com/repos/swolchok/yaml-cpp/stargazers","contributors_url":"https://api.github.com/repos/swolchok/yaml-cpp/contributors","subscribers_url":"https://api.github.com/repos/swolchok/yaml-cpp/subscribers","subscription_url":"https://api.github.com/repos/swolchok/yaml-cpp/subscription","commits_url":"https://api.github.com/repos/swolchok/yaml-cpp/commits{/sha}","git_commits_url":"https://api.github.com/repos/swolchok/yaml-cpp/git/commits{/sha}","comments_url":"https://api.github.com/repos/swolchok/yaml-cpp/comments{/number}","issue_comment_url":"https://api.github.com/repos/swolchok/yaml-cpp/issues/comments{/number}","contents_url":"https://api.github.com/repos/swolchok/yaml-cpp/contents/{+path}","compare_url":"https://api.github.com/repos/swolchok/yaml-cpp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/swolchok/yaml-cpp/merges","archive_url":"https://api.github.com/repos/swolchok/yaml-cpp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/swolchok/yaml-cpp/downloads","issues_url":"https://api.github.com/repos/swolchok/yaml-cpp/issues{/number}","pulls_url":"https://api.github.com/repos/swolchok/yaml-cpp/pulls{/number}","milestones_url":"https://api.github.com/repos/swolchok/yaml-cpp/milestones{/number}","notifications_url":"https://api.github.com/repos/swolchok/yaml-cpp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/swolchok/yaml-cpp/labels{/name}","releases_url":"https://api.github.com/repos/swolchok/yaml-cpp/releases{/id}","deployments_url":"https://api.github.com/repos/swolchok/yaml-cpp/deployments","created_at":"2016-01-12T23:22:35Z","updated_at":"2016-01-12T23:22:37Z","pushed_at":"2016-01-13T19:14:50Z","git_url":"git://github.com/swolchok/yaml-cpp.git","ssh_url":"git@github.com:swolchok/yaml-cpp.git","clone_url":"https://github.com/swolchok/yaml-cpp.git","svn_url":"https://github.com/swolchok/yaml-cpp","homepage":"","size":2455,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"jbeder:master","ref":"master","sha":"e92321aee52fd27566601f9cca53ba90b41e15c1","user":{"login":"jbeder","id":1059334,"avatar_url":"https://avatars.githubusercontent.com/u/1059334?v=3","gravatar_id":"","url":"https://api.github.com/users/jbeder","html_url":"https://github.com/jbeder","followers_url":"https://api.github.com/users/jbeder/followers","following_url":"https://api.github.com/users/jbeder/following{/other_user}","gists_url":"https://api.github.com/users/jbeder/gists{/gist_id}","starred_url":"https://api.github.com/users/jbeder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbeder/subscriptions","organizations_url":"https://api.github.com/users/jbeder/orgs","repos_url":"https://api.github.com/users/jbeder/repos","events_url":"https://api.github.com/users/jbeder/events{/privacy}","received_events_url":"https://api.github.com/users/jbeder/received_events","type":"User","site_admin":false},"repo":{"id":33100064,"name":"yaml-cpp","full_name":"jbeder/yaml-cpp","owner":{"login":"jbeder","id":1059334,"avatar_url":"https://avatars.githubusercontent.com/u/1059334?v=3","gravatar_id":"","url":"https://api.github.com/users/jbeder","html_url":"https://github.com/jbeder","followers_url":"https://api.github.com/users/jbeder/followers","following_url":"https://api.github.com/users/jbeder/following{/other_user}","gists_url":"https://api.github.com/users/jbeder/gists{/gist_id}","starred_url":"https://api.github.com/users/jbeder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbeder/subscriptions","organizations_url":"https://api.github.com/users/jbeder/orgs","repos_url":"https://api.github.com/users/jbeder/repos","events_url":"https://api.github.com/users/jbeder/events{/privacy}","received_events_url":"https://api.github.com/users/jbeder/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jbeder/yaml-cpp","description":"A YAML parser and emitter in C++","fork":false,"url":"https://api.github.com/repos/jbeder/yaml-cpp","forks_url":"https://api.github.com/repos/jbeder/yaml-cpp/forks","keys_url":"https://api.github.com/repos/jbeder/yaml-cpp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jbeder/yaml-cpp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jbeder/yaml-cpp/teams","hooks_url":"https://api.github.com/repos/jbeder/yaml-cpp/hooks","issue_events_url":"https://api.github.com/repos/jbeder/yaml-cpp/issues/events{/number}","events_url":"https://api.github.com/repos/jbeder/yaml-cpp/events","assignees_url":"https://api.github.com/repos/jbeder/yaml-cpp/assignees{/user}","branches_url":"https://api.github.com/repos/jbeder/yaml-cpp/branches{/branch}","tags_url":"https://api.github.com/repos/jbeder/yaml-cpp/tags","blobs_url":"https://api.github.com/repos/jbeder/yaml-cpp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jbeder/yaml-cpp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jbeder/yaml-cpp/git/refs{/sha}","trees_url":"https://api.github.com/repos/jbeder/yaml-cpp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jbeder/yaml-cpp/statuses/{sha}","languages_url":"https://api.github.com/repos/jbeder/yaml-cpp/languages","stargazers_url":"https://api.github.com/repos/jbeder/yaml-cpp/stargazers","contributors_url":"https://api.github.com/repos/jbeder/yaml-cpp/contributors","subscribers_url":"https://api.github.com/repos/jbeder/yaml-cpp/subscribers","subscription_url":"https://api.github.com/repos/jbeder/yaml-cpp/subscription","commits_url":"https://api.github.com/repos/jbeder/yaml-cpp/commits{/sha}","git_commits_url":"https://api.github.com/repos/jbeder/yaml-cpp/git/commits{/sha}","comments_url":"https://api.github.com/repos/jbeder/yaml-cpp/comments{/number}","issue_comment_url":"https://api.github.com/repos/jbeder/yaml-cpp/issues/comments{/number}","contents_url":"https://api.github.com/repos/jbeder/yaml-cpp/contents/{+path}","compare_url":"https://api.github.com/repos/jbeder/yaml-cpp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jbeder/yaml-cpp/merges","archive_url":"https://api.github.com/repos/jbeder/yaml-cpp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jbeder/yaml-cpp/downloads","issues_url":"https://api.github.com/repos/jbeder/yaml-cpp/issues{/number}","pulls_url":"https://api.github.com/repos/jbeder/yaml-cpp/pulls{/number}","milestones_url":"https://api.github.com/repos/jbeder/yaml-cpp/milestones{/number}","notifications_url":"https://api.github.com/repos/jbeder/yaml-cpp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jbeder/yaml-cpp/labels{/name}","releases_url":"https://api.github.com/repos/jbeder/yaml-cpp/releases{/id}","deployments_url":"https://api.github.com/repos/jbeder/yaml-cpp/deployments","created_at":"2015-03-30T02:52:32Z","updated_at":"2016-01-30T18:30:01Z","pushed_at":"2016-01-31T00:32:16Z","git_url":"git://github.com/jbeder/yaml-cpp.git","ssh_url":"git@github.com:jbeder/yaml-cpp.git","clone_url":"https://github.com/jbeder/yaml-cpp.git","svn_url":"https://github.com/jbeder/yaml-cpp","homepage":"","size":3150,"stargazers_count":250,"watchers_count":250,"language":"C++","has_issues":true,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":76,"mirror_url":null,"open_issues_count":75,"forks":76,"open_issues":75,"watchers":250,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jbeder/yaml-cpp/pulls/356"},"html":{"href":"https://github.com/jbeder/yaml-cpp/pull/356"},"issue":{"href":"https://api.github.com/repos/jbeder/yaml-cpp/issues/356"},"comments":{"href":"https://api.github.com/repos/jbeder/yaml-cpp/issues/356/comments"},"review_comments":{"href":"https://api.github.com/repos/jbeder/yaml-cpp/pulls/356/comments"},"review_comment":{"href":"https://api.github.com/repos/jbeder/yaml-cpp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jbeder/yaml-cpp/pulls/356/commits"},"statuses":{"href":"https://api.github.com/repos/jbeder/yaml-cpp/statuses/82b4e0dc2802164041c2d1194cf1d42ad26d284a"}}}}