{"action":"created","comment":{"url":"https://api.github.com/repos/dartsim/dart/pulls/comments/41713140","id":41713140,"diff_hunk":"@@ -211,24 +201,37 @@ TEST(UriHelpers, getUri_InputIsUri_DoesNotChange)\n   };\n \n   for (const std::string& testUri : testUris)\n-    EXPECT_EQ(testUri, Uri::getUri(testUri));\n+    EXPECT_EQ(testUri, Uri::createFromString(testUri).toString());\n }\n \n TEST(UriHelpers, getUri_InputIsPath_AppendsFileSchema)\n {\n+#ifdef _WIN32\n+  std::vector<std::string> testPaths = {\n+    \"C:\\\\foo\",\n+    \"C:\\\\foo\\\\\",\n+    \"C:\\\\foo\\\\bar\",\n+  };\n+#else\n   std::vector<std::string> testPaths = {\n-    \"foo\",\n-    \"foo/\",\n-    \"foo/bar\",\n     \"/foo\",\n     \"/foo/\",\n     \"/foo/bar\"\n   };\n+#endif\n \n   for(const std::string& testPath : testPaths)\n   {\n-    const std::string testUri = \"file://\" + testUri;\n-    EXPECT_EQ(testUri, Uri::getUri(testUri));\n+#ifdef _WIN32\n+    // On Windows, an absolute path does not begin with forward slash but a \n+    // file URI needs it to represent an empty authority,\n+    const std::string testUri = \"file:///\" + testPath;\n+#else\n+    // wherease on Unix systems the additional forward slash is not required\n+    // since an absolute paht already has it.","path":"unittests/testUri.cpp","position":137,"original_position":137,"commit_id":"a220ee1db3aa970b4c2abb2f588eba00d8bb5d5b","original_commit_id":"a220ee1db3aa970b4c2abb2f588eba00d8bb5d5b","user":{"login":"jslee02","id":4038467,"avatar_url":"https://avatars.githubusercontent.com/u/4038467?v=3","gravatar_id":"","url":"https://api.github.com/users/jslee02","html_url":"https://github.com/jslee02","followers_url":"https://api.github.com/users/jslee02/followers","following_url":"https://api.github.com/users/jslee02/following{/other_user}","gists_url":"https://api.github.com/users/jslee02/gists{/gist_id}","starred_url":"https://api.github.com/users/jslee02/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jslee02/subscriptions","organizations_url":"https://api.github.com/users/jslee02/orgs","repos_url":"https://api.github.com/users/jslee02/repos","events_url":"https://api.github.com/users/jslee02/events{/privacy}","received_events_url":"https://api.github.com/users/jslee02/received_events","type":"User","site_admin":false},"body":":+1: ","created_at":"2015-10-11T17:33:18Z","updated_at":"2015-10-11T17:33:18Z","html_url":"https://github.com/dartsim/dart/pull/517#discussion_r41713140","pull_request_url":"https://api.github.com/repos/dartsim/dart/pulls/517","_links":{"self":{"href":"https://api.github.com/repos/dartsim/dart/pulls/comments/41713140"},"html":{"href":"https://github.com/dartsim/dart/pull/517#discussion_r41713140"},"pull_request":{"href":"https://api.github.com/repos/dartsim/dart/pulls/517"}}},"pull_request":{"url":"https://api.github.com/repos/dartsim/dart/pulls/517","id":47360404,"html_url":"https://github.com/dartsim/dart/pull/517","diff_url":"https://github.com/dartsim/dart/pull/517.diff","patch_url":"https://github.com/dartsim/dart/pull/517.patch","issue_url":"https://api.github.com/repos/dartsim/dart/issues/517","number":517,"state":"open","locked":false,"title":"Improving URI to be compatible with Windows","user":{"login":"jslee02","id":4038467,"avatar_url":"https://avatars.githubusercontent.com/u/4038467?v=3","gravatar_id":"","url":"https://api.github.com/users/jslee02","html_url":"https://github.com/jslee02","followers_url":"https://api.github.com/users/jslee02/followers","following_url":"https://api.github.com/users/jslee02/following{/other_user}","gists_url":"https://api.github.com/users/jslee02/gists{/gist_id}","starred_url":"https://api.github.com/users/jslee02/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jslee02/subscriptions","organizations_url":"https://api.github.com/users/jslee02/orgs","repos_url":"https://api.github.com/users/jslee02/repos","events_url":"https://api.github.com/users/jslee02/events{/privacy}","received_events_url":"https://api.github.com/users/jslee02/received_events","type":"User","site_admin":false},"body":"This PR makes URI to work on Windows and resolve issues reported in #488 and #497. \r\n\r\nMost changes are related to file URI (file://your/path) to make it compatible on Unix and Windows. Here is a summary of the changes:\r\n* Every function that takes in a filename as a string (e.g., skel/urdf/sdf parsers) now takes `Uri`.\r\n* In order to pass filename to those functions as before, you can use `Uri::createFromPath(filename)`.\r\n* A `Uri` can be created from file URI string (e.g., file:///foo/bar.txt and file:///C:/foo/bar.txt) or raw file path (e.g., /foo/bar.txt and C:/foo/bar.txt).\r\n* Every path should be absolute path.\r\n\r\nYou can find more details at the discussions in #497.\r\n\r\nNote that this PR also makes the AppVeyor CI tests to pass on Windows so afterward PRs of this should pass AppVeyor CI tests as well.","created_at":"2015-10-11T05:18:08Z","updated_at":"2015-10-11T17:33:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ea067904ced770143698dbc63164acf4f827c105","assignee":null,"milestone":{"url":"https://api.github.com/repos/dartsim/dart/milestones/11","html_url":"https://github.com/dartsim/dart/milestones/DART%205.1.0","labels_url":"https://api.github.com/repos/dartsim/dart/milestones/11/labels","id":1173741,"number":11,"title":"DART 5.1.0","description":"","creator":{"login":"jslee02","id":4038467,"avatar_url":"https://avatars.githubusercontent.com/u/4038467?v=3","gravatar_id":"","url":"https://api.github.com/users/jslee02","html_url":"https://github.com/jslee02","followers_url":"https://api.github.com/users/jslee02/followers","following_url":"https://api.github.com/users/jslee02/following{/other_user}","gists_url":"https://api.github.com/users/jslee02/gists{/gist_id}","starred_url":"https://api.github.com/users/jslee02/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jslee02/subscriptions","organizations_url":"https://api.github.com/users/jslee02/orgs","repos_url":"https://api.github.com/users/jslee02/repos","events_url":"https://api.github.com/users/jslee02/events{/privacy}","received_events_url":"https://api.github.com/users/jslee02/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":50,"state":"open","created_at":"2015-06-21T00:19:16Z","updated_at":"2015-10-11T05:18:08Z","due_on":"2015-09-28T04:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/dartsim/dart/pulls/517/commits","review_comments_url":"https://api.github.com/repos/dartsim/dart/pulls/517/comments","review_comment_url":"https://api.github.com/repos/dartsim/dart/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dartsim/dart/issues/517/comments","statuses_url":"https://api.github.com/repos/dartsim/dart/statuses/a220ee1db3aa970b4c2abb2f588eba00d8bb5d5b","head":{"label":"dartsim:portable_uri","ref":"portable_uri","sha":"a220ee1db3aa970b4c2abb2f588eba00d8bb5d5b","user":{"login":"dartsim","id":4191609,"avatar_url":"https://avatars.githubusercontent.com/u/4191609?v=3","gravatar_id":"","url":"https://api.github.com/users/dartsim","html_url":"https://github.com/dartsim","followers_url":"https://api.github.com/users/dartsim/followers","following_url":"https://api.github.com/users/dartsim/following{/other_user}","gists_url":"https://api.github.com/users/dartsim/gists{/gist_id}","starred_url":"https://api.github.com/users/dartsim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dartsim/subscriptions","organizations_url":"https://api.github.com/users/dartsim/orgs","repos_url":"https://api.github.com/users/dartsim/repos","events_url":"https://api.github.com/users/dartsim/events{/privacy}","received_events_url":"https://api.github.com/users/dartsim/received_events","type":"Organization","site_admin":false},"repo":{"id":2418592,"name":"dart","full_name":"dartsim/dart","owner":{"login":"dartsim","id":4191609,"avatar_url":"https://avatars.githubusercontent.com/u/4191609?v=3","gravatar_id":"","url":"https://api.github.com/users/dartsim","html_url":"https://github.com/dartsim","followers_url":"https://api.github.com/users/dartsim/followers","following_url":"https://api.github.com/users/dartsim/following{/other_user}","gists_url":"https://api.github.com/users/dartsim/gists{/gist_id}","starred_url":"https://api.github.com/users/dartsim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dartsim/subscriptions","organizations_url":"https://api.github.com/users/dartsim/orgs","repos_url":"https://api.github.com/users/dartsim/repos","events_url":"https://api.github.com/users/dartsim/events{/privacy}","received_events_url":"https://api.github.com/users/dartsim/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dartsim/dart","description":"Dynamic Animation and Robotics Toolkit","fork":false,"url":"https://api.github.com/repos/dartsim/dart","forks_url":"https://api.github.com/repos/dartsim/dart/forks","keys_url":"https://api.github.com/repos/dartsim/dart/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dartsim/dart/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dartsim/dart/teams","hooks_url":"https://api.github.com/repos/dartsim/dart/hooks","issue_events_url":"https://api.github.com/repos/dartsim/dart/issues/events{/number}","events_url":"https://api.github.com/repos/dartsim/dart/events","assignees_url":"https://api.github.com/repos/dartsim/dart/assignees{/user}","branches_url":"https://api.github.com/repos/dartsim/dart/branches{/branch}","tags_url":"https://api.github.com/repos/dartsim/dart/tags","blobs_url":"https://api.github.com/repos/dartsim/dart/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dartsim/dart/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dartsim/dart/git/refs{/sha}","trees_url":"https://api.github.com/repos/dartsim/dart/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dartsim/dart/statuses/{sha}","languages_url":"https://api.github.com/repos/dartsim/dart/languages","stargazers_url":"https://api.github.com/repos/dartsim/dart/stargazers","contributors_url":"https://api.github.com/repos/dartsim/dart/contributors","subscribers_url":"https://api.github.com/repos/dartsim/dart/subscribers","subscription_url":"https://api.github.com/repos/dartsim/dart/subscription","commits_url":"https://api.github.com/repos/dartsim/dart/commits{/sha}","git_commits_url":"https://api.github.com/repos/dartsim/dart/git/commits{/sha}","comments_url":"https://api.github.com/repos/dartsim/dart/comments{/number}","issue_comment_url":"https://api.github.com/repos/dartsim/dart/issues/comments{/number}","contents_url":"https://api.github.com/repos/dartsim/dart/contents/{+path}","compare_url":"https://api.github.com/repos/dartsim/dart/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dartsim/dart/merges","archive_url":"https://api.github.com/repos/dartsim/dart/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dartsim/dart/downloads","issues_url":"https://api.github.com/repos/dartsim/dart/issues{/number}","pulls_url":"https://api.github.com/repos/dartsim/dart/pulls{/number}","milestones_url":"https://api.github.com/repos/dartsim/dart/milestones{/number}","notifications_url":"https://api.github.com/repos/dartsim/dart/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dartsim/dart/labels{/name}","releases_url":"https://api.github.com/repos/dartsim/dart/releases{/id}","created_at":"2011-09-19T21:53:51Z","updated_at":"2015-10-02T10:35:11Z","pushed_at":"2015-10-11T15:03:21Z","git_url":"git://github.com/dartsim/dart.git","ssh_url":"git@github.com:dartsim/dart.git","clone_url":"https://github.com/dartsim/dart.git","svn_url":"https://github.com/dartsim/dart","homepage":"http://dartsim.github.io/","size":114569,"stargazers_count":73,"watchers_count":73,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":49,"mirror_url":null,"open_issues_count":110,"forks":49,"open_issues":110,"watchers":73,"default_branch":"master"}},"base":{"label":"dartsim:master","ref":"master","sha":"eca6c2a00b9a4b79f50f2f4d66806e4bef1d81d0","user":{"login":"dartsim","id":4191609,"avatar_url":"https://avatars.githubusercontent.com/u/4191609?v=3","gravatar_id":"","url":"https://api.github.com/users/dartsim","html_url":"https://github.com/dartsim","followers_url":"https://api.github.com/users/dartsim/followers","following_url":"https://api.github.com/users/dartsim/following{/other_user}","gists_url":"https://api.github.com/users/dartsim/gists{/gist_id}","starred_url":"https://api.github.com/users/dartsim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dartsim/subscriptions","organizations_url":"https://api.github.com/users/dartsim/orgs","repos_url":"https://api.github.com/users/dartsim/repos","events_url":"https://api.github.com/users/dartsim/events{/privacy}","received_events_url":"https://api.github.com/users/dartsim/received_events","type":"Organization","site_admin":false},"repo":{"id":2418592,"name":"dart","full_name":"dartsim/dart","owner":{"login":"dartsim","id":4191609,"avatar_url":"https://avatars.githubusercontent.com/u/4191609?v=3","gravatar_id":"","url":"https://api.github.com/users/dartsim","html_url":"https://github.com/dartsim","followers_url":"https://api.github.com/users/dartsim/followers","following_url":"https://api.github.com/users/dartsim/following{/other_user}","gists_url":"https://api.github.com/users/dartsim/gists{/gist_id}","starred_url":"https://api.github.com/users/dartsim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dartsim/subscriptions","organizations_url":"https://api.github.com/users/dartsim/orgs","repos_url":"https://api.github.com/users/dartsim/repos","events_url":"https://api.github.com/users/dartsim/events{/privacy}","received_events_url":"https://api.github.com/users/dartsim/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dartsim/dart","description":"Dynamic Animation and Robotics Toolkit","fork":false,"url":"https://api.github.com/repos/dartsim/dart","forks_url":"https://api.github.com/repos/dartsim/dart/forks","keys_url":"https://api.github.com/repos/dartsim/dart/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dartsim/dart/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dartsim/dart/teams","hooks_url":"https://api.github.com/repos/dartsim/dart/hooks","issue_events_url":"https://api.github.com/repos/dartsim/dart/issues/events{/number}","events_url":"https://api.github.com/repos/dartsim/dart/events","assignees_url":"https://api.github.com/repos/dartsim/dart/assignees{/user}","branches_url":"https://api.github.com/repos/dartsim/dart/branches{/branch}","tags_url":"https://api.github.com/repos/dartsim/dart/tags","blobs_url":"https://api.github.com/repos/dartsim/dart/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dartsim/dart/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dartsim/dart/git/refs{/sha}","trees_url":"https://api.github.com/repos/dartsim/dart/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dartsim/dart/statuses/{sha}","languages_url":"https://api.github.com/repos/dartsim/dart/languages","stargazers_url":"https://api.github.com/repos/dartsim/dart/stargazers","contributors_url":"https://api.github.com/repos/dartsim/dart/contributors","subscribers_url":"https://api.github.com/repos/dartsim/dart/subscribers","subscription_url":"https://api.github.com/repos/dartsim/dart/subscription","commits_url":"https://api.github.com/repos/dartsim/dart/commits{/sha}","git_commits_url":"https://api.github.com/repos/dartsim/dart/git/commits{/sha}","comments_url":"https://api.github.com/repos/dartsim/dart/comments{/number}","issue_comment_url":"https://api.github.com/repos/dartsim/dart/issues/comments{/number}","contents_url":"https://api.github.com/repos/dartsim/dart/contents/{+path}","compare_url":"https://api.github.com/repos/dartsim/dart/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dartsim/dart/merges","archive_url":"https://api.github.com/repos/dartsim/dart/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dartsim/dart/downloads","issues_url":"https://api.github.com/repos/dartsim/dart/issues{/number}","pulls_url":"https://api.github.com/repos/dartsim/dart/pulls{/number}","milestones_url":"https://api.github.com/repos/dartsim/dart/milestones{/number}","notifications_url":"https://api.github.com/repos/dartsim/dart/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dartsim/dart/labels{/name}","releases_url":"https://api.github.com/repos/dartsim/dart/releases{/id}","created_at":"2011-09-19T21:53:51Z","updated_at":"2015-10-02T10:35:11Z","pushed_at":"2015-10-11T15:03:21Z","git_url":"git://github.com/dartsim/dart.git","ssh_url":"git@github.com:dartsim/dart.git","clone_url":"https://github.com/dartsim/dart.git","svn_url":"https://github.com/dartsim/dart","homepage":"http://dartsim.github.io/","size":114569,"stargazers_count":73,"watchers_count":73,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":49,"mirror_url":null,"open_issues_count":110,"forks":49,"open_issues":110,"watchers":73,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dartsim/dart/pulls/517"},"html":{"href":"https://github.com/dartsim/dart/pull/517"},"issue":{"href":"https://api.github.com/repos/dartsim/dart/issues/517"},"comments":{"href":"https://api.github.com/repos/dartsim/dart/issues/517/comments"},"review_comments":{"href":"https://api.github.com/repos/dartsim/dart/pulls/517/comments"},"review_comment":{"href":"https://api.github.com/repos/dartsim/dart/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dartsim/dart/pulls/517/commits"},"statuses":{"href":"https://api.github.com/repos/dartsim/dart/statuses/a220ee1db3aa970b4c2abb2f588eba00d8bb5d5b"}}}}