{"action":"created","comment":{"url":"https://api.github.com/repos/nodejs/node/pulls/comments/116381308","pull_request_review_id":38000357,"id":116381308,"diff_hunk":"@@ -53,20 +55,38 @@ const ENTER = { name: 'enter' };\n const CLEAR = { ctrl: true, name: 'u' };\n // Common message bits\n const prompt = '> ';\n-const replDisabled = '\\nPersistent history support disabled. Set the ' +\n-                     'NODE_REPL_HISTORY environment\\nvariable to a valid, ' +\n-                     'user-writable path to enable.\\n';\n-const convertMsg = '\\nConverting old JSON repl history to line-separated ' +\n-                   'history.\\nThe new repl history file can be found at ' +\n-                   path.join(common.tmpDir, '.node_repl_history') + '.\\n';\n-const homedirErr = '\\nError: Could not get the home directory.\\n' +\n-                   'REPL session history will not be persisted.\\n';\n-const replFailedRead = '\\nError: Could not open history file.\\n' +\n-                       'REPL session history will not be persisted.\\n';\n-const sameHistoryFilePaths = '\\nThe old repl history file has the same name ' +\n-                             'and location as the new one i.e., ' +\n-                             path.join(common.tmpDir, '.node_repl_history') +\n-                             ' and is empty.\\nUsing it as is.\\n';\n+const replDisabled = tagLF`\n+\n+  Persistent history support disabled. Set the NODE_REPL_HISTORY environment\n+  variable to a valid, user-writable path to enable.\n+\n+`;\n+const convertMsg = tagLF`\n+\n+  Converting old JSON repl history to line-separated history.\n+  The new repl history file can be found at ${\n+  path.join(common.tmpDir, '.node_repl_history')}.\n+\n+`;\n+const homedirErr = tagLF`\n+\n+  Error: Could not get the home directory.\n+  REPL session history will not be persisted.\n+\n+`;\n+const replFailedRead = tagLF`\n+\n+  Error: Could not open history file.\n+  REPL session history will not be persisted.\n+\n+`;\n+const sameHistoryFilePaths = tagLF`\n+","path":"test/parallel/test-repl-persistent-history.js","position":53,"original_position":53,"commit_id":"7f3201301ec5049bc83660e2b8251a8f431f66f9","original_commit_id":"7f3201301ec5049bc83660e2b8251a8f431f66f9","user":{"login":"vsemozhetbyt","id":10393198,"avatar_url":"https://avatars2.githubusercontent.com/u/10393198?v=3","gravatar_id":"","url":"https://api.github.com/users/vsemozhetbyt","html_url":"https://github.com/vsemozhetbyt","followers_url":"https://api.github.com/users/vsemozhetbyt/followers","following_url":"https://api.github.com/users/vsemozhetbyt/following{/other_user}","gists_url":"https://api.github.com/users/vsemozhetbyt/gists{/gist_id}","starred_url":"https://api.github.com/users/vsemozhetbyt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vsemozhetbyt/subscriptions","organizations_url":"https://api.github.com/users/vsemozhetbyt/orgs","repos_url":"https://api.github.com/users/vsemozhetbyt/repos","events_url":"https://api.github.com/users/vsemozhetbyt/events{/privacy}","received_events_url":"https://api.github.com/users/vsemozhetbyt/received_events","type":"User","site_admin":false},"body":"I will fix, thank you.","created_at":"2017-05-14T13:43:30Z","updated_at":"2017-05-14T13:43:30Z","html_url":"https://github.com/nodejs/node/pull/13016#discussion_r116381308","pull_request_url":"https://api.github.com/repos/nodejs/node/pulls/13016","_links":{"self":{"href":"https://api.github.com/repos/nodejs/node/pulls/comments/116381308"},"html":{"href":"https://github.com/nodejs/node/pull/13016#discussion_r116381308"},"pull_request":{"href":"https://api.github.com/repos/nodejs/node/pulls/13016"}}},"pull_request":{"url":"https://api.github.com/repos/nodejs/node/pulls/13016","id":120456260,"html_url":"https://github.com/nodejs/node/pull/13016","diff_url":"https://github.com/nodejs/node/pull/13016.diff","patch_url":"https://github.com/nodejs/node/pull/13016.patch","issue_url":"https://api.github.com/repos/nodejs/node/issues/13016","number":13016,"state":"open","locked":false,"title":"test: introduce tag functions to handle long strings in code","user":{"login":"vsemozhetbyt","id":10393198,"avatar_url":"https://avatars2.githubusercontent.com/u/10393198?v=3","gravatar_id":"","url":"https://api.github.com/users/vsemozhetbyt","html_url":"https://github.com/vsemozhetbyt","followers_url":"https://api.github.com/users/vsemozhetbyt/followers","following_url":"https://api.github.com/users/vsemozhetbyt/following{/other_user}","gists_url":"https://api.github.com/users/vsemozhetbyt/gists{/gist_id}","starred_url":"https://api.github.com/users/vsemozhetbyt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vsemozhetbyt/subscriptions","organizations_url":"https://api.github.com/users/vsemozhetbyt/orgs","repos_url":"https://api.github.com/users/vsemozhetbyt/repos","events_url":"https://api.github.com/users/vsemozhetbyt/events{/privacy}","received_events_url":"https://api.github.com/users/vsemozhetbyt/received_events","type":"User","site_admin":false},"body":"##### Checklist\r\n- [x] `make -j4 test` (UNIX), or `vcbuild test` (Windows) passes\r\n- [x] tests and/or benchmarks are included\r\n- [x] documentation is changed or added\r\n- [x] commit message follows [commit guidelines](https://github.com/nodejs/node/blob/master/CONTRIBUTING.md#commit-message-guidelines)\r\n\r\n##### Affected core subsystem(s)\r\ntest\r\n\r\nMultiline template literals in ES6 make long strings handling easier in code. However, there are many annoying nits that prevent this option from using in many cases: code block indentation adds unwanted spaces to these strings, leading and trailing backticks break alignment or add unwanted leading and trailing line breaks.\r\n\r\nThis PR proposes 4 helper functions to mitigate these difficulties:\r\n\r\n1. `common.tagGlue()` — joins a multiline template literal seamlessly, i.e. removes all literal line breaks and leading spaces (handy to code big text blobs not intended for human reading).\r\n2. `common.tagUnwrap()` — joins a multiline template literal with a space, i.e. replaces all literal line breaks and leading spaces with a space, then trims one leading and one trailing space (handy to code long readable text lines).\r\n3. `common.tagLF()` — preserves line breaks as `\\n`, but removes two framing line breaks and only auxiliary indents (handy to code multiline readable text, JavaScript metacode, HTML markup etc).\r\n4. `common.tagCRLF()` — same as `tagLF()`, but replaces all literal `\\n` by `\\r\\n` (handy to code raw HTTP requests/responses).\r\n\r\nYou can see examples in the [proposed doc fragments](https://github.com/vsemozhetbyt/node/blob/09bec290645409c81133ab4020bd82463f56f488/test/common/README.md#tagglue).\r\n\r\nThis PR also demonstrates the applying these functions to many test fragments.\r\n\r\nAll these functions leave interpolated variables untouched, only literal parts are processed. In most cases, these functions get multiline strings with leading and trailing line breaks: this allows to divide code noise (backticks etc) and pure data. These leading and trailing line breaks are stripped by the tag functions. This should be taken into account: if the result needs a line break in the very end, an additional line break should be added (beware, for example, HTTP raw code — see samples in the second commit).\r\n\r\nI understand that this is a big PR and mostly based on personal taste. So see it as a strawman and feel free to reject without thorough explanations.\r\n\r\nThough the diff seems huge, the changes are mostly trivial, concern multiline blocks formatting and are easy to skim.","created_at":"2017-05-13T17:27:41Z","updated_at":"2017-05-14T13:43:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"952f6e0229c2a75a5ccda5b0ac57e8f6c5340556","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/nodejs/node/pulls/13016/commits","review_comments_url":"https://api.github.com/repos/nodejs/node/pulls/13016/comments","review_comment_url":"https://api.github.com/repos/nodejs/node/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nodejs/node/issues/13016/comments","statuses_url":"https://api.github.com/repos/nodejs/node/statuses/7f3201301ec5049bc83660e2b8251a8f431f66f9","head":{"label":"vsemozhetbyt:test-common-tags","ref":"test-common-tags","sha":"7f3201301ec5049bc83660e2b8251a8f431f66f9","user":{"login":"vsemozhetbyt","id":10393198,"avatar_url":"https://avatars2.githubusercontent.com/u/10393198?v=3","gravatar_id":"","url":"https://api.github.com/users/vsemozhetbyt","html_url":"https://github.com/vsemozhetbyt","followers_url":"https://api.github.com/users/vsemozhetbyt/followers","following_url":"https://api.github.com/users/vsemozhetbyt/following{/other_user}","gists_url":"https://api.github.com/users/vsemozhetbyt/gists{/gist_id}","starred_url":"https://api.github.com/users/vsemozhetbyt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vsemozhetbyt/subscriptions","organizations_url":"https://api.github.com/users/vsemozhetbyt/orgs","repos_url":"https://api.github.com/users/vsemozhetbyt/repos","events_url":"https://api.github.com/users/vsemozhetbyt/events{/privacy}","received_events_url":"https://api.github.com/users/vsemozhetbyt/received_events","type":"User","site_admin":false},"repo":{"id":83805480,"name":"node","full_name":"vsemozhetbyt/node","owner":{"login":"vsemozhetbyt","id":10393198,"avatar_url":"https://avatars2.githubusercontent.com/u/10393198?v=3","gravatar_id":"","url":"https://api.github.com/users/vsemozhetbyt","html_url":"https://github.com/vsemozhetbyt","followers_url":"https://api.github.com/users/vsemozhetbyt/followers","following_url":"https://api.github.com/users/vsemozhetbyt/following{/other_user}","gists_url":"https://api.github.com/users/vsemozhetbyt/gists{/gist_id}","starred_url":"https://api.github.com/users/vsemozhetbyt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vsemozhetbyt/subscriptions","organizations_url":"https://api.github.com/users/vsemozhetbyt/orgs","repos_url":"https://api.github.com/users/vsemozhetbyt/repos","events_url":"https://api.github.com/users/vsemozhetbyt/events{/privacy}","received_events_url":"https://api.github.com/users/vsemozhetbyt/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vsemozhetbyt/node","description":"Node.js JavaScript runtime :sparkles::turtle::rocket::sparkles:","fork":true,"url":"https://api.github.com/repos/vsemozhetbyt/node","forks_url":"https://api.github.com/repos/vsemozhetbyt/node/forks","keys_url":"https://api.github.com/repos/vsemozhetbyt/node/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vsemozhetbyt/node/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vsemozhetbyt/node/teams","hooks_url":"https://api.github.com/repos/vsemozhetbyt/node/hooks","issue_events_url":"https://api.github.com/repos/vsemozhetbyt/node/issues/events{/number}","events_url":"https://api.github.com/repos/vsemozhetbyt/node/events","assignees_url":"https://api.github.com/repos/vsemozhetbyt/node/assignees{/user}","branches_url":"https://api.github.com/repos/vsemozhetbyt/node/branches{/branch}","tags_url":"https://api.github.com/repos/vsemozhetbyt/node/tags","blobs_url":"https://api.github.com/repos/vsemozhetbyt/node/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vsemozhetbyt/node/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vsemozhetbyt/node/git/refs{/sha}","trees_url":"https://api.github.com/repos/vsemozhetbyt/node/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vsemozhetbyt/node/statuses/{sha}","languages_url":"https://api.github.com/repos/vsemozhetbyt/node/languages","stargazers_url":"https://api.github.com/repos/vsemozhetbyt/node/stargazers","contributors_url":"https://api.github.com/repos/vsemozhetbyt/node/contributors","subscribers_url":"https://api.github.com/repos/vsemozhetbyt/node/subscribers","subscription_url":"https://api.github.com/repos/vsemozhetbyt/node/subscription","commits_url":"https://api.github.com/repos/vsemozhetbyt/node/commits{/sha}","git_commits_url":"https://api.github.com/repos/vsemozhetbyt/node/git/commits{/sha}","comments_url":"https://api.github.com/repos/vsemozhetbyt/node/comments{/number}","issue_comment_url":"https://api.github.com/repos/vsemozhetbyt/node/issues/comments{/number}","contents_url":"https://api.github.com/repos/vsemozhetbyt/node/contents/{+path}","compare_url":"https://api.github.com/repos/vsemozhetbyt/node/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vsemozhetbyt/node/merges","archive_url":"https://api.github.com/repos/vsemozhetbyt/node/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vsemozhetbyt/node/downloads","issues_url":"https://api.github.com/repos/vsemozhetbyt/node/issues{/number}","pulls_url":"https://api.github.com/repos/vsemozhetbyt/node/pulls{/number}","milestones_url":"https://api.github.com/repos/vsemozhetbyt/node/milestones{/number}","notifications_url":"https://api.github.com/repos/vsemozhetbyt/node/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vsemozhetbyt/node/labels{/name}","releases_url":"https://api.github.com/repos/vsemozhetbyt/node/releases{/id}","deployments_url":"https://api.github.com/repos/vsemozhetbyt/node/deployments","created_at":"2017-03-03T14:18:11Z","updated_at":"2017-03-03T14:18:36Z","pushed_at":"2017-05-14T13:07:40Z","git_url":"git://github.com/vsemozhetbyt/node.git","ssh_url":"git@github.com:vsemozhetbyt/node.git","clone_url":"https://github.com/vsemozhetbyt/node.git","svn_url":"https://github.com/vsemozhetbyt/node","homepage":"https://nodejs.org","size":280648,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"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":"nodejs:master","ref":"master","sha":"84fc069b9578e2917fa9a23d1c738b5cffcc4910","user":{"login":"nodejs","id":9950313,"avatar_url":"https://avatars0.githubusercontent.com/u/9950313?v=3","gravatar_id":"","url":"https://api.github.com/users/nodejs","html_url":"https://github.com/nodejs","followers_url":"https://api.github.com/users/nodejs/followers","following_url":"https://api.github.com/users/nodejs/following{/other_user}","gists_url":"https://api.github.com/users/nodejs/gists{/gist_id}","starred_url":"https://api.github.com/users/nodejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nodejs/subscriptions","organizations_url":"https://api.github.com/users/nodejs/orgs","repos_url":"https://api.github.com/users/nodejs/repos","events_url":"https://api.github.com/users/nodejs/events{/privacy}","received_events_url":"https://api.github.com/users/nodejs/received_events","type":"Organization","site_admin":false},"repo":{"id":27193779,"name":"node","full_name":"nodejs/node","owner":{"login":"nodejs","id":9950313,"avatar_url":"https://avatars0.githubusercontent.com/u/9950313?v=3","gravatar_id":"","url":"https://api.github.com/users/nodejs","html_url":"https://github.com/nodejs","followers_url":"https://api.github.com/users/nodejs/followers","following_url":"https://api.github.com/users/nodejs/following{/other_user}","gists_url":"https://api.github.com/users/nodejs/gists{/gist_id}","starred_url":"https://api.github.com/users/nodejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nodejs/subscriptions","organizations_url":"https://api.github.com/users/nodejs/orgs","repos_url":"https://api.github.com/users/nodejs/repos","events_url":"https://api.github.com/users/nodejs/events{/privacy}","received_events_url":"https://api.github.com/users/nodejs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nodejs/node","description":"Node.js JavaScript runtime :sparkles::turtle::rocket::sparkles:","fork":false,"url":"https://api.github.com/repos/nodejs/node","forks_url":"https://api.github.com/repos/nodejs/node/forks","keys_url":"https://api.github.com/repos/nodejs/node/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nodejs/node/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nodejs/node/teams","hooks_url":"https://api.github.com/repos/nodejs/node/hooks","issue_events_url":"https://api.github.com/repos/nodejs/node/issues/events{/number}","events_url":"https://api.github.com/repos/nodejs/node/events","assignees_url":"https://api.github.com/repos/nodejs/node/assignees{/user}","branches_url":"https://api.github.com/repos/nodejs/node/branches{/branch}","tags_url":"https://api.github.com/repos/nodejs/node/tags","blobs_url":"https://api.github.com/repos/nodejs/node/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nodejs/node/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nodejs/node/git/refs{/sha}","trees_url":"https://api.github.com/repos/nodejs/node/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nodejs/node/statuses/{sha}","languages_url":"https://api.github.com/repos/nodejs/node/languages","stargazers_url":"https://api.github.com/repos/nodejs/node/stargazers","contributors_url":"https://api.github.com/repos/nodejs/node/contributors","subscribers_url":"https://api.github.com/repos/nodejs/node/subscribers","subscription_url":"https://api.github.com/repos/nodejs/node/subscription","commits_url":"https://api.github.com/repos/nodejs/node/commits{/sha}","git_commits_url":"https://api.github.com/repos/nodejs/node/git/commits{/sha}","comments_url":"https://api.github.com/repos/nodejs/node/comments{/number}","issue_comment_url":"https://api.github.com/repos/nodejs/node/issues/comments{/number}","contents_url":"https://api.github.com/repos/nodejs/node/contents/{+path}","compare_url":"https://api.github.com/repos/nodejs/node/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nodejs/node/merges","archive_url":"https://api.github.com/repos/nodejs/node/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nodejs/node/downloads","issues_url":"https://api.github.com/repos/nodejs/node/issues{/number}","pulls_url":"https://api.github.com/repos/nodejs/node/pulls{/number}","milestones_url":"https://api.github.com/repos/nodejs/node/milestones{/number}","notifications_url":"https://api.github.com/repos/nodejs/node/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nodejs/node/labels{/name}","releases_url":"https://api.github.com/repos/nodejs/node/releases{/id}","deployments_url":"https://api.github.com/repos/nodejs/node/deployments","created_at":"2014-11-26T19:57:11Z","updated_at":"2017-05-14T13:43:23Z","pushed_at":"2017-05-14T13:07:00Z","git_url":"git://github.com/nodejs/node.git","ssh_url":"git@github.com:nodejs/node.git","clone_url":"https://github.com/nodejs/node.git","svn_url":"https://github.com/nodejs/node","homepage":"https://nodejs.org","size":287348,"stargazers_count":34822,"watchers_count":34822,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6663,"mirror_url":null,"open_issues_count":1081,"forks":6663,"open_issues":1081,"watchers":34822,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nodejs/node/pulls/13016"},"html":{"href":"https://github.com/nodejs/node/pull/13016"},"issue":{"href":"https://api.github.com/repos/nodejs/node/issues/13016"},"comments":{"href":"https://api.github.com/repos/nodejs/node/issues/13016/comments"},"review_comments":{"href":"https://api.github.com/repos/nodejs/node/pulls/13016/comments"},"review_comment":{"href":"https://api.github.com/repos/nodejs/node/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nodejs/node/pulls/13016/commits"},"statuses":{"href":"https://api.github.com/repos/nodejs/node/statuses/7f3201301ec5049bc83660e2b8251a8f431f66f9"}}}}
{"actor":{"display_login":"vsemozhetbyt"}}