{"action":"created","comment":{"url":"https://api.github.com/repos/googlecodelabs/tools/pulls/comments/53225203","id":53225203,"diff_hunk":"@@ -0,0 +1,339 @@\n+// Copyright 2016 Google Inc. All Rights Reserved.\n+//\n+// Licensed under the Apache License, Version 2.0 (the \"License\");\n+// you may not use this file except in compliance with the License.\n+// You may obtain a copy of the License at\n+//\n+//     http://www.apache.org/licenses/LICENSE-2.0\n+//\n+// Unless required by applicable law or agreed to in writing, software\n+// distributed under the License is distributed on an \"AS IS\" BASIS,\n+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+// See the License for the specific language governing permissions and\n+// limitations under the License.\n+\n+package md\n+\n+import (\n+\t\"errors\"\n+\t\"fmt\"\n+\t\"reflect\"\n+\t\"strings\"\n+\t\"testing\"\n+\t\"time\"\n+\n+\t\"github.com/googlecodelabs/tools/claat/types\"\n+\n+\t\"golang.org/x/net/html\"\n+)\n+\n+const empty = \"\"\n+\n+var errNonNil = errors.New(empty)\n+\n+func buildParserWithStep(markup string) *parserState {\n+\n+\tps := parserState{\n+\t\ttzr: html.NewTokenizer(strings.NewReader(markup)),\n+\t\tc:   &types.Codelab{},\n+\t}\n+\tps.currentStep = ps.c.NewStep(\"title\")\n+\treturn &ps\n+}\n+\n+func TestHandleCodelabTitle(t *testing.T) {\n+\t// Set up.\n+\ttitle := \"Egret\"\n+\tps := buildParserWithStep(fmt.Sprintf(\"<h1>%s</h1>\", title))\n+\tps.advance()\n+\thandleCodelabTitle(ps)\n+\n+\tif ps.c.Title != title {\n+\t\tt.Errorf(\"[%q] expected %v, got %v\", title, title, ps.c.Title)\n+\t}\n+}\n+\n+func TestProcessDuration(t *testing.T) {\n+\ttype TestCase struct {\n+\t\tin  string\n+\t\tout time.Duration\n+\t\terr error\n+\t}\n+\ttests := []TestCase{","path":"claat/parser/md/parse_test.go","position":null,"original_position":62,"commit_id":"5ce26a2edb891ddc2eb10754214352f1edee76d9","original_commit_id":"d83e820441a3ff9c5568d773898ea229d3b307b9","user":{"login":"crhym3","id":25405,"avatar_url":"https://avatars.githubusercontent.com/u/25405?v=3","gravatar_id":"","url":"https://api.github.com/users/crhym3","html_url":"https://github.com/crhym3","followers_url":"https://api.github.com/users/crhym3/followers","following_url":"https://api.github.com/users/crhym3/following{/other_user}","gists_url":"https://api.github.com/users/crhym3/gists{/gist_id}","starred_url":"https://api.github.com/users/crhym3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crhym3/subscriptions","organizations_url":"https://api.github.com/users/crhym3/orgs","repos_url":"https://api.github.com/users/crhym3/repos","events_url":"https://api.github.com/users/crhym3/events{/privacy}","received_events_url":"https://api.github.com/users/crhym3/received_events","type":"User","site_admin":false},"body":"yeah, go fmt will expand struct{type1; type2; type3} into multiline, I just wrote it like that for brevity :) \r\nmy main point was the format of the slice elements, e.g. `{\"1:00\", time.Hour, nil}`.","created_at":"2016-02-17T20:19:51Z","updated_at":"2016-02-17T20:19:51Z","html_url":"https://github.com/googlecodelabs/tools/pull/4#discussion_r53225203","pull_request_url":"https://api.github.com/repos/googlecodelabs/tools/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/googlecodelabs/tools/pulls/comments/53225203"},"html":{"href":"https://github.com/googlecodelabs/tools/pull/4#discussion_r53225203"},"pull_request":{"href":"https://api.github.com/repos/googlecodelabs/tools/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/googlecodelabs/tools/pulls/4","id":59087597,"html_url":"https://github.com/googlecodelabs/tools/pull/4","diff_url":"https://github.com/googlecodelabs/tools/pull/4.diff","patch_url":"https://github.com/googlecodelabs/tools/pull/4.patch","issue_url":"https://api.github.com/repos/googlecodelabs/tools/issues/4","number":4,"state":"open","locked":false,"title":"Add Markdown parsing.","user":{"login":"chrisrecher","id":4482615,"avatar_url":"https://avatars.githubusercontent.com/u/4482615?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisrecher","html_url":"https://github.com/chrisrecher","followers_url":"https://api.github.com/users/chrisrecher/followers","following_url":"https://api.github.com/users/chrisrecher/following{/other_user}","gists_url":"https://api.github.com/users/chrisrecher/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisrecher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisrecher/subscriptions","organizations_url":"https://api.github.com/users/chrisrecher/orgs","repos_url":"https://api.github.com/users/chrisrecher/repos","events_url":"https://api.github.com/users/chrisrecher/events{/privacy}","received_events_url":"https://api.github.com/users/chrisrecher/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-02-11T20:19:27Z","updated_at":"2016-02-17T20:19:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0732dde4c38824878337fdb9f7bfe970c84ef4b9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/googlecodelabs/tools/pulls/4/commits","review_comments_url":"https://api.github.com/repos/googlecodelabs/tools/pulls/4/comments","review_comment_url":"https://api.github.com/repos/googlecodelabs/tools/pulls/comments{/number}","comments_url":"https://api.github.com/repos/googlecodelabs/tools/issues/4/comments","statuses_url":"https://api.github.com/repos/googlecodelabs/tools/statuses/5ce26a2edb891ddc2eb10754214352f1edee76d9","head":{"label":"chrisrecher:master","ref":"master","sha":"5ce26a2edb891ddc2eb10754214352f1edee76d9","user":{"login":"chrisrecher","id":4482615,"avatar_url":"https://avatars.githubusercontent.com/u/4482615?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisrecher","html_url":"https://github.com/chrisrecher","followers_url":"https://api.github.com/users/chrisrecher/followers","following_url":"https://api.github.com/users/chrisrecher/following{/other_user}","gists_url":"https://api.github.com/users/chrisrecher/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisrecher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisrecher/subscriptions","organizations_url":"https://api.github.com/users/chrisrecher/orgs","repos_url":"https://api.github.com/users/chrisrecher/repos","events_url":"https://api.github.com/users/chrisrecher/events{/privacy}","received_events_url":"https://api.github.com/users/chrisrecher/received_events","type":"User","site_admin":false},"repo":{"id":50882381,"name":"tools","full_name":"chrisrecher/tools","owner":{"login":"chrisrecher","id":4482615,"avatar_url":"https://avatars.githubusercontent.com/u/4482615?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisrecher","html_url":"https://github.com/chrisrecher","followers_url":"https://api.github.com/users/chrisrecher/followers","following_url":"https://api.github.com/users/chrisrecher/following{/other_user}","gists_url":"https://api.github.com/users/chrisrecher/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisrecher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisrecher/subscriptions","organizations_url":"https://api.github.com/users/chrisrecher/orgs","repos_url":"https://api.github.com/users/chrisrecher/repos","events_url":"https://api.github.com/users/chrisrecher/events{/privacy}","received_events_url":"https://api.github.com/users/chrisrecher/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chrisrecher/tools","description":"Codelabs management & hosting tools","fork":true,"url":"https://api.github.com/repos/chrisrecher/tools","forks_url":"https://api.github.com/repos/chrisrecher/tools/forks","keys_url":"https://api.github.com/repos/chrisrecher/tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chrisrecher/tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chrisrecher/tools/teams","hooks_url":"https://api.github.com/repos/chrisrecher/tools/hooks","issue_events_url":"https://api.github.com/repos/chrisrecher/tools/issues/events{/number}","events_url":"https://api.github.com/repos/chrisrecher/tools/events","assignees_url":"https://api.github.com/repos/chrisrecher/tools/assignees{/user}","branches_url":"https://api.github.com/repos/chrisrecher/tools/branches{/branch}","tags_url":"https://api.github.com/repos/chrisrecher/tools/tags","blobs_url":"https://api.github.com/repos/chrisrecher/tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chrisrecher/tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chrisrecher/tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/chrisrecher/tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chrisrecher/tools/statuses/{sha}","languages_url":"https://api.github.com/repos/chrisrecher/tools/languages","stargazers_url":"https://api.github.com/repos/chrisrecher/tools/stargazers","contributors_url":"https://api.github.com/repos/chrisrecher/tools/contributors","subscribers_url":"https://api.github.com/repos/chrisrecher/tools/subscribers","subscription_url":"https://api.github.com/repos/chrisrecher/tools/subscription","commits_url":"https://api.github.com/repos/chrisrecher/tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/chrisrecher/tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/chrisrecher/tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/chrisrecher/tools/issues/comments{/number}","contents_url":"https://api.github.com/repos/chrisrecher/tools/contents/{+path}","compare_url":"https://api.github.com/repos/chrisrecher/tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chrisrecher/tools/merges","archive_url":"https://api.github.com/repos/chrisrecher/tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chrisrecher/tools/downloads","issues_url":"https://api.github.com/repos/chrisrecher/tools/issues{/number}","pulls_url":"https://api.github.com/repos/chrisrecher/tools/pulls{/number}","milestones_url":"https://api.github.com/repos/chrisrecher/tools/milestones{/number}","notifications_url":"https://api.github.com/repos/chrisrecher/tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chrisrecher/tools/labels{/name}","releases_url":"https://api.github.com/repos/chrisrecher/tools/releases{/id}","deployments_url":"https://api.github.com/repos/chrisrecher/tools/deployments","created_at":"2016-02-02T00:36:33Z","updated_at":"2016-02-02T00:36:34Z","pushed_at":"2016-02-17T19:27:03Z","git_url":"git://github.com/chrisrecher/tools.git","ssh_url":"git@github.com:chrisrecher/tools.git","clone_url":"https://github.com/chrisrecher/tools.git","svn_url":"https://github.com/chrisrecher/tools","homepage":null,"size":71,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"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":"googlecodelabs:master","ref":"master","sha":"8bc7ff8e1a735a1f6cc00e700c3dd84310ec1acc","user":{"login":"googlecodelabs","id":13681719,"avatar_url":"https://avatars.githubusercontent.com/u/13681719?v=3","gravatar_id":"","url":"https://api.github.com/users/googlecodelabs","html_url":"https://github.com/googlecodelabs","followers_url":"https://api.github.com/users/googlecodelabs/followers","following_url":"https://api.github.com/users/googlecodelabs/following{/other_user}","gists_url":"https://api.github.com/users/googlecodelabs/gists{/gist_id}","starred_url":"https://api.github.com/users/googlecodelabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googlecodelabs/subscriptions","organizations_url":"https://api.github.com/users/googlecodelabs/orgs","repos_url":"https://api.github.com/users/googlecodelabs/repos","events_url":"https://api.github.com/users/googlecodelabs/events{/privacy}","received_events_url":"https://api.github.com/users/googlecodelabs/received_events","type":"Organization","site_admin":false},"repo":{"id":50182994,"name":"tools","full_name":"googlecodelabs/tools","owner":{"login":"googlecodelabs","id":13681719,"avatar_url":"https://avatars.githubusercontent.com/u/13681719?v=3","gravatar_id":"","url":"https://api.github.com/users/googlecodelabs","html_url":"https://github.com/googlecodelabs","followers_url":"https://api.github.com/users/googlecodelabs/followers","following_url":"https://api.github.com/users/googlecodelabs/following{/other_user}","gists_url":"https://api.github.com/users/googlecodelabs/gists{/gist_id}","starred_url":"https://api.github.com/users/googlecodelabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googlecodelabs/subscriptions","organizations_url":"https://api.github.com/users/googlecodelabs/orgs","repos_url":"https://api.github.com/users/googlecodelabs/repos","events_url":"https://api.github.com/users/googlecodelabs/events{/privacy}","received_events_url":"https://api.github.com/users/googlecodelabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/googlecodelabs/tools","description":"Codelabs management & hosting tools","fork":false,"url":"https://api.github.com/repos/googlecodelabs/tools","forks_url":"https://api.github.com/repos/googlecodelabs/tools/forks","keys_url":"https://api.github.com/repos/googlecodelabs/tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/googlecodelabs/tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/googlecodelabs/tools/teams","hooks_url":"https://api.github.com/repos/googlecodelabs/tools/hooks","issue_events_url":"https://api.github.com/repos/googlecodelabs/tools/issues/events{/number}","events_url":"https://api.github.com/repos/googlecodelabs/tools/events","assignees_url":"https://api.github.com/repos/googlecodelabs/tools/assignees{/user}","branches_url":"https://api.github.com/repos/googlecodelabs/tools/branches{/branch}","tags_url":"https://api.github.com/repos/googlecodelabs/tools/tags","blobs_url":"https://api.github.com/repos/googlecodelabs/tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/googlecodelabs/tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/googlecodelabs/tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/googlecodelabs/tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/googlecodelabs/tools/statuses/{sha}","languages_url":"https://api.github.com/repos/googlecodelabs/tools/languages","stargazers_url":"https://api.github.com/repos/googlecodelabs/tools/stargazers","contributors_url":"https://api.github.com/repos/googlecodelabs/tools/contributors","subscribers_url":"https://api.github.com/repos/googlecodelabs/tools/subscribers","subscription_url":"https://api.github.com/repos/googlecodelabs/tools/subscription","commits_url":"https://api.github.com/repos/googlecodelabs/tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/googlecodelabs/tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/googlecodelabs/tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/googlecodelabs/tools/issues/comments{/number}","contents_url":"https://api.github.com/repos/googlecodelabs/tools/contents/{+path}","compare_url":"https://api.github.com/repos/googlecodelabs/tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/googlecodelabs/tools/merges","archive_url":"https://api.github.com/repos/googlecodelabs/tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/googlecodelabs/tools/downloads","issues_url":"https://api.github.com/repos/googlecodelabs/tools/issues{/number}","pulls_url":"https://api.github.com/repos/googlecodelabs/tools/pulls{/number}","milestones_url":"https://api.github.com/repos/googlecodelabs/tools/milestones{/number}","notifications_url":"https://api.github.com/repos/googlecodelabs/tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/googlecodelabs/tools/labels{/name}","releases_url":"https://api.github.com/repos/googlecodelabs/tools/releases{/id}","deployments_url":"https://api.github.com/repos/googlecodelabs/tools/deployments","created_at":"2016-01-22T13:28:44Z","updated_at":"2016-01-22T22:32:26Z","pushed_at":"2016-02-17T19:27:03Z","git_url":"git://github.com/googlecodelabs/tools.git","ssh_url":"git@github.com:googlecodelabs/tools.git","clone_url":"https://github.com/googlecodelabs/tools.git","svn_url":"https://github.com/googlecodelabs/tools","homepage":null,"size":61,"stargazers_count":1,"watchers_count":1,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":2,"forks":2,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/googlecodelabs/tools/pulls/4"},"html":{"href":"https://github.com/googlecodelabs/tools/pull/4"},"issue":{"href":"https://api.github.com/repos/googlecodelabs/tools/issues/4"},"comments":{"href":"https://api.github.com/repos/googlecodelabs/tools/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/googlecodelabs/tools/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/googlecodelabs/tools/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/googlecodelabs/tools/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/googlecodelabs/tools/statuses/5ce26a2edb891ddc2eb10754214352f1edee76d9"}}}}