{"action":"created","comment":{"url":"https://api.github.com/repos/vim-jp/vital.vim/pulls/comments/57461533","id":57461533,"diff_hunk":"@@ -0,0 +1,202 @@\n+\n+Describe Data.String\n+  Before all\n+    let Vital = vital#of('vital')\n+    let Path = Vital.import('System.Filepath')\n+    let String = Vital.import('Data.String')\n+  End\n+\n+  Context .remove_ansi_sequences()\n+    It should remove ANSI sequences in {val}\n+      let val = \"\\033[47m\\033[32mGreen\\033[0m\"\n+      Assert Equals(String.remove_ansi_sequences(val), 'Green')\n+    End\n+  End\n+\n+  Describe .escape_pattern()\n+    It escape unescaped characters in {str} which involved in regex pattern\n+      Assert Equals(String.escape_pattern('^\\a\\b.*$'), '\\^\\\\a\\\\b\\.\\*\\$')\n+      Assert Equals(\n+            \\ String.escape_pattern('C:\\Windows\\Test.txt'),\n+            \\ 'C:\\\\Windows\\\\Test\\.txt',\n+            \\)\n+    End\n+    It escape escaped characters in {str} which involved in regex pattern\n+      Assert Equals(\n+            \\ String.escape_pattern(String.escape_pattern('^\\a\\b.*$')),\n+            \\ '\\\\\\^\\\\\\\\a\\\\\\\\b\\\\\\.\\\\\\*\\\\\\$'\n+            \\)\n+      Assert Equals(\n+            \\ String.escape_pattern(String.escape_pattern('C:\\Windows\\Test.txt')),\n+            \\ 'C:\\\\\\\\Windows\\\\\\\\Test\\\\\\.txt',\n+            \\)\n+    End\n+  End\n+\n+  Describe .unescape_pattern()\n+    It unescape escaped characters in {str} which involved in regex pattern\n+      Assert Equals(String.unescape_pattern('\\^\\\\a\\\\b\\.\\*\\$'), '^\\a\\b.*$')\n+      Assert Equals(\n+            \\ String.unescape_pattern('C:\\\\Windows\\\\Test\\.txt'),\n+            \\ 'C:\\Windows\\Test.txt'\n+            \\)\n+    End\n+\n+    It unescape unescaped characters in {str} which involved in regex pattern\n+      Assert Equals(\n+            \\ String.unescape_pattern(String.unescape_pattern('\\\\\\^\\\\\\\\a\\\\\\\\b\\\\\\.\\\\\\*\\\\\\$')),\n+            \\ '^\\a\\b.*$'\n+            \\)\n+      Assert Equals(\n+            \\ String.unescape_pattern(String.unescape_pattern('C:\\\\\\\\Windows\\\\\\\\Test\\\\\\.txt')),\n+            \\ 'C:\\Windows\\Test.txt'\n+            \\)\n+    End\n+  End\n+\n+  Describe .unescape()\n+    It unescape escaped {chars} in {str}\n+      Assert Equals(\n+            \\ String.unescape('\\\\\\^\\*\\a\\b\\[\\]', '\\^*[]'),\n+            \\ '\\^*\\a\\b[]',\n+            \\)\n+      Assert Equals(\n+            \\ String.unescape('\\*n\\n\\\\n', '*\\'),\n+            \\ '*n\\n\\n',\n+            \\)\n+      Assert Equals(\n+            \\ String.unescape('\\\\n\\\\n\\\\n', '\\'),\n+            \\ '\\n\\n\\n',\n+            \\)\n+      Assert Equals(\n+            \\ String.unescape('\\\\\\\\n\\\\\\\\n\\\\\\\\n', '\\'),\n+            \\ '\\\\n\\\\n\\\\n',\n+            \\)","path":"test/Data/String.vimspec","position":74,"original_position":74,"commit_id":"d4860ec212203b6e4707624f7404ee829e646432","original_commit_id":"d4860ec212203b6e4707624f7404ee829e646432","user":{"login":"thinca","id":20474,"avatar_url":"https://avatars.githubusercontent.com/u/20474?v=3","gravatar_id":"","url":"https://api.github.com/users/thinca","html_url":"https://github.com/thinca","followers_url":"https://api.github.com/users/thinca/followers","following_url":"https://api.github.com/users/thinca/following{/other_user}","gists_url":"https://api.github.com/users/thinca/gists{/gist_id}","starred_url":"https://api.github.com/users/thinca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thinca/subscriptions","organizations_url":"https://api.github.com/users/thinca/orgs","repos_url":"https://api.github.com/users/thinca/repos","events_url":"https://api.github.com/users/thinca/events{/privacy}","received_events_url":"https://api.github.com/users/thinca/received_events","type":"User","site_admin":false},"body":"`\\&` を `unescape()` するテストを追加してみてください。","created_at":"2016-03-25T16:39:29Z","updated_at":"2016-03-25T16:39:29Z","html_url":"https://github.com/vim-jp/vital.vim/pull/406#discussion_r57461533","pull_request_url":"https://api.github.com/repos/vim-jp/vital.vim/pulls/406","_links":{"self":{"href":"https://api.github.com/repos/vim-jp/vital.vim/pulls/comments/57461533"},"html":{"href":"https://github.com/vim-jp/vital.vim/pull/406#discussion_r57461533"},"pull_request":{"href":"https://api.github.com/repos/vim-jp/vital.vim/pulls/406"}}},"pull_request":{"url":"https://api.github.com/repos/vim-jp/vital.vim/pulls/406","id":63319677,"html_url":"https://github.com/vim-jp/vital.vim/pull/406","diff_url":"https://github.com/vim-jp/vital.vim/pull/406.diff","patch_url":"https://github.com/vim-jp/vital.vim/pull/406.patch","issue_url":"https://api.github.com/repos/vim-jp/vital.vim/issues/406","number":406,"state":"open","locked":false,"title":"Improve Data.String","user":{"login":"lambdalisue","id":546312,"avatar_url":"https://avatars.githubusercontent.com/u/546312?v=3","gravatar_id":"","url":"https://api.github.com/users/lambdalisue","html_url":"https://github.com/lambdalisue","followers_url":"https://api.github.com/users/lambdalisue/followers","following_url":"https://api.github.com/users/lambdalisue/following{/other_user}","gists_url":"https://api.github.com/users/lambdalisue/gists{/gist_id}","starred_url":"https://api.github.com/users/lambdalisue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lambdalisue/subscriptions","organizations_url":"https://api.github.com/users/lambdalisue/orgs","repos_url":"https://api.github.com/users/lambdalisue/repos","events_url":"https://api.github.com/users/lambdalisue/events{/privacy}","received_events_url":"https://api.github.com/users/lambdalisue/received_events","type":"User","site_admin":false},"body":"`Data.String` にあるべきだと思った関数をことごとく追加しました\r\n\r\n- <del>引数解析の際に非クオート領域の空白文字で区切るための `spiltargs()`</del>\r\n- ANSIシーケンスを削除する `remove_ansi_sequences()`\r\n- 正規表現字に文字列内に含まれている指示文字をエスケープする `escape_pattern()` (`Prelude.escape_pattern()` と同様だがテスト・ドキュメント有り）\r\n- 上記でエスケープされた文字列を非エスケープ状態に戻す `unescape_pattern()`\r\n- 文字列内に含まれる任意の文字を非エスケープする `unescape()`\r\n- `System.Process` で追加しようとしていた文字列処理に関連する処理いくつか\r\n\r\nhttps://github.com/vim-jp/vital.vim/issues/365#issuecomment-168027759\r\nhttps://github.com/vim-jp/vital.vim/pull/397","created_at":"2016-03-18T02:18:36Z","updated_at":"2016-03-25T16:39:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dd4bd807702801ea5764ce6ff77e932a0386ff69","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/vim-jp/vital.vim/pulls/406/commits","review_comments_url":"https://api.github.com/repos/vim-jp/vital.vim/pulls/406/comments","review_comment_url":"https://api.github.com/repos/vim-jp/vital.vim/pulls/comments{/number}","comments_url":"https://api.github.com/repos/vim-jp/vital.vim/issues/406/comments","statuses_url":"https://api.github.com/repos/vim-jp/vital.vim/statuses/d4860ec212203b6e4707624f7404ee829e646432","head":{"label":"vim-jp:feature/improve-Data.String","ref":"feature/improve-Data.String","sha":"d4860ec212203b6e4707624f7404ee829e646432","user":{"login":"vim-jp","id":1051958,"avatar_url":"https://avatars.githubusercontent.com/u/1051958?v=3","gravatar_id":"","url":"https://api.github.com/users/vim-jp","html_url":"https://github.com/vim-jp","followers_url":"https://api.github.com/users/vim-jp/followers","following_url":"https://api.github.com/users/vim-jp/following{/other_user}","gists_url":"https://api.github.com/users/vim-jp/gists{/gist_id}","starred_url":"https://api.github.com/users/vim-jp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vim-jp/subscriptions","organizations_url":"https://api.github.com/users/vim-jp/orgs","repos_url":"https://api.github.com/users/vim-jp/repos","events_url":"https://api.github.com/users/vim-jp/events{/privacy}","received_events_url":"https://api.github.com/users/vim-jp/received_events","type":"Organization","site_admin":false},"repo":{"id":1308435,"name":"vital.vim","full_name":"vim-jp/vital.vim","owner":{"login":"vim-jp","id":1051958,"avatar_url":"https://avatars.githubusercontent.com/u/1051958?v=3","gravatar_id":"","url":"https://api.github.com/users/vim-jp","html_url":"https://github.com/vim-jp","followers_url":"https://api.github.com/users/vim-jp/followers","following_url":"https://api.github.com/users/vim-jp/following{/other_user}","gists_url":"https://api.github.com/users/vim-jp/gists{/gist_id}","starred_url":"https://api.github.com/users/vim-jp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vim-jp/subscriptions","organizations_url":"https://api.github.com/users/vim-jp/orgs","repos_url":"https://api.github.com/users/vim-jp/repos","events_url":"https://api.github.com/users/vim-jp/events{/privacy}","received_events_url":"https://api.github.com/users/vim-jp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/vim-jp/vital.vim","description":"A comprehensive Vim utility functions for Vim plugins","fork":false,"url":"https://api.github.com/repos/vim-jp/vital.vim","forks_url":"https://api.github.com/repos/vim-jp/vital.vim/forks","keys_url":"https://api.github.com/repos/vim-jp/vital.vim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vim-jp/vital.vim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vim-jp/vital.vim/teams","hooks_url":"https://api.github.com/repos/vim-jp/vital.vim/hooks","issue_events_url":"https://api.github.com/repos/vim-jp/vital.vim/issues/events{/number}","events_url":"https://api.github.com/repos/vim-jp/vital.vim/events","assignees_url":"https://api.github.com/repos/vim-jp/vital.vim/assignees{/user}","branches_url":"https://api.github.com/repos/vim-jp/vital.vim/branches{/branch}","tags_url":"https://api.github.com/repos/vim-jp/vital.vim/tags","blobs_url":"https://api.github.com/repos/vim-jp/vital.vim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vim-jp/vital.vim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vim-jp/vital.vim/git/refs{/sha}","trees_url":"https://api.github.com/repos/vim-jp/vital.vim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vim-jp/vital.vim/statuses/{sha}","languages_url":"https://api.github.com/repos/vim-jp/vital.vim/languages","stargazers_url":"https://api.github.com/repos/vim-jp/vital.vim/stargazers","contributors_url":"https://api.github.com/repos/vim-jp/vital.vim/contributors","subscribers_url":"https://api.github.com/repos/vim-jp/vital.vim/subscribers","subscription_url":"https://api.github.com/repos/vim-jp/vital.vim/subscription","commits_url":"https://api.github.com/repos/vim-jp/vital.vim/commits{/sha}","git_commits_url":"https://api.github.com/repos/vim-jp/vital.vim/git/commits{/sha}","comments_url":"https://api.github.com/repos/vim-jp/vital.vim/comments{/number}","issue_comment_url":"https://api.github.com/repos/vim-jp/vital.vim/issues/comments{/number}","contents_url":"https://api.github.com/repos/vim-jp/vital.vim/contents/{+path}","compare_url":"https://api.github.com/repos/vim-jp/vital.vim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vim-jp/vital.vim/merges","archive_url":"https://api.github.com/repos/vim-jp/vital.vim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vim-jp/vital.vim/downloads","issues_url":"https://api.github.com/repos/vim-jp/vital.vim/issues{/number}","pulls_url":"https://api.github.com/repos/vim-jp/vital.vim/pulls{/number}","milestones_url":"https://api.github.com/repos/vim-jp/vital.vim/milestones{/number}","notifications_url":"https://api.github.com/repos/vim-jp/vital.vim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vim-jp/vital.vim/labels{/name}","releases_url":"https://api.github.com/repos/vim-jp/vital.vim/releases{/id}","deployments_url":"https://api.github.com/repos/vim-jp/vital.vim/deployments","created_at":"2011-01-30T08:40:37Z","updated_at":"2016-03-23T16:26:28Z","pushed_at":"2016-03-25T15:20:58Z","git_url":"git://github.com/vim-jp/vital.vim.git","ssh_url":"git@github.com:vim-jp/vital.vim.git","clone_url":"https://github.com/vim-jp/vital.vim.git","svn_url":"https://github.com/vim-jp/vital.vim","homepage":"","size":3648,"stargazers_count":217,"watchers_count":217,"language":"VimL","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":39,"mirror_url":null,"open_issues_count":57,"forks":39,"open_issues":57,"watchers":217,"default_branch":"master"}},"base":{"label":"vim-jp:master","ref":"master","sha":"90b88c35a154bae8016a25f82dadca192b795918","user":{"login":"vim-jp","id":1051958,"avatar_url":"https://avatars.githubusercontent.com/u/1051958?v=3","gravatar_id":"","url":"https://api.github.com/users/vim-jp","html_url":"https://github.com/vim-jp","followers_url":"https://api.github.com/users/vim-jp/followers","following_url":"https://api.github.com/users/vim-jp/following{/other_user}","gists_url":"https://api.github.com/users/vim-jp/gists{/gist_id}","starred_url":"https://api.github.com/users/vim-jp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vim-jp/subscriptions","organizations_url":"https://api.github.com/users/vim-jp/orgs","repos_url":"https://api.github.com/users/vim-jp/repos","events_url":"https://api.github.com/users/vim-jp/events{/privacy}","received_events_url":"https://api.github.com/users/vim-jp/received_events","type":"Organization","site_admin":false},"repo":{"id":1308435,"name":"vital.vim","full_name":"vim-jp/vital.vim","owner":{"login":"vim-jp","id":1051958,"avatar_url":"https://avatars.githubusercontent.com/u/1051958?v=3","gravatar_id":"","url":"https://api.github.com/users/vim-jp","html_url":"https://github.com/vim-jp","followers_url":"https://api.github.com/users/vim-jp/followers","following_url":"https://api.github.com/users/vim-jp/following{/other_user}","gists_url":"https://api.github.com/users/vim-jp/gists{/gist_id}","starred_url":"https://api.github.com/users/vim-jp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vim-jp/subscriptions","organizations_url":"https://api.github.com/users/vim-jp/orgs","repos_url":"https://api.github.com/users/vim-jp/repos","events_url":"https://api.github.com/users/vim-jp/events{/privacy}","received_events_url":"https://api.github.com/users/vim-jp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/vim-jp/vital.vim","description":"A comprehensive Vim utility functions for Vim plugins","fork":false,"url":"https://api.github.com/repos/vim-jp/vital.vim","forks_url":"https://api.github.com/repos/vim-jp/vital.vim/forks","keys_url":"https://api.github.com/repos/vim-jp/vital.vim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vim-jp/vital.vim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vim-jp/vital.vim/teams","hooks_url":"https://api.github.com/repos/vim-jp/vital.vim/hooks","issue_events_url":"https://api.github.com/repos/vim-jp/vital.vim/issues/events{/number}","events_url":"https://api.github.com/repos/vim-jp/vital.vim/events","assignees_url":"https://api.github.com/repos/vim-jp/vital.vim/assignees{/user}","branches_url":"https://api.github.com/repos/vim-jp/vital.vim/branches{/branch}","tags_url":"https://api.github.com/repos/vim-jp/vital.vim/tags","blobs_url":"https://api.github.com/repos/vim-jp/vital.vim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vim-jp/vital.vim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vim-jp/vital.vim/git/refs{/sha}","trees_url":"https://api.github.com/repos/vim-jp/vital.vim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vim-jp/vital.vim/statuses/{sha}","languages_url":"https://api.github.com/repos/vim-jp/vital.vim/languages","stargazers_url":"https://api.github.com/repos/vim-jp/vital.vim/stargazers","contributors_url":"https://api.github.com/repos/vim-jp/vital.vim/contributors","subscribers_url":"https://api.github.com/repos/vim-jp/vital.vim/subscribers","subscription_url":"https://api.github.com/repos/vim-jp/vital.vim/subscription","commits_url":"https://api.github.com/repos/vim-jp/vital.vim/commits{/sha}","git_commits_url":"https://api.github.com/repos/vim-jp/vital.vim/git/commits{/sha}","comments_url":"https://api.github.com/repos/vim-jp/vital.vim/comments{/number}","issue_comment_url":"https://api.github.com/repos/vim-jp/vital.vim/issues/comments{/number}","contents_url":"https://api.github.com/repos/vim-jp/vital.vim/contents/{+path}","compare_url":"https://api.github.com/repos/vim-jp/vital.vim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vim-jp/vital.vim/merges","archive_url":"https://api.github.com/repos/vim-jp/vital.vim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vim-jp/vital.vim/downloads","issues_url":"https://api.github.com/repos/vim-jp/vital.vim/issues{/number}","pulls_url":"https://api.github.com/repos/vim-jp/vital.vim/pulls{/number}","milestones_url":"https://api.github.com/repos/vim-jp/vital.vim/milestones{/number}","notifications_url":"https://api.github.com/repos/vim-jp/vital.vim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vim-jp/vital.vim/labels{/name}","releases_url":"https://api.github.com/repos/vim-jp/vital.vim/releases{/id}","deployments_url":"https://api.github.com/repos/vim-jp/vital.vim/deployments","created_at":"2011-01-30T08:40:37Z","updated_at":"2016-03-23T16:26:28Z","pushed_at":"2016-03-25T15:20:58Z","git_url":"git://github.com/vim-jp/vital.vim.git","ssh_url":"git@github.com:vim-jp/vital.vim.git","clone_url":"https://github.com/vim-jp/vital.vim.git","svn_url":"https://github.com/vim-jp/vital.vim","homepage":"","size":3648,"stargazers_count":217,"watchers_count":217,"language":"VimL","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":39,"mirror_url":null,"open_issues_count":57,"forks":39,"open_issues":57,"watchers":217,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/vim-jp/vital.vim/pulls/406"},"html":{"href":"https://github.com/vim-jp/vital.vim/pull/406"},"issue":{"href":"https://api.github.com/repos/vim-jp/vital.vim/issues/406"},"comments":{"href":"https://api.github.com/repos/vim-jp/vital.vim/issues/406/comments"},"review_comments":{"href":"https://api.github.com/repos/vim-jp/vital.vim/pulls/406/comments"},"review_comment":{"href":"https://api.github.com/repos/vim-jp/vital.vim/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/vim-jp/vital.vim/pulls/406/commits"},"statuses":{"href":"https://api.github.com/repos/vim-jp/vital.vim/statuses/d4860ec212203b6e4707624f7404ee829e646432"}}}}