{"action":"created","comment":{"url":"https://api.github.com/repos/bluss/ndarray/pulls/comments/185941721","pull_request_review_id":117436766,"id":185941721,"diff_hunk":"@@ -1372,6 +1424,19 @@ fn to_owned_neg_stride() {\n     assert_eq!(c, co);\n }\n \n+#[test]\n+fn discontiguous_owned_to_owned() {\n+    let mut c = arr2(&[[1, 2, 3],\n+                       [4, 5, 6]]);\n+    c.slice_inplace(s![.., ..;2]);\n+\n+    let co = c.to_owned();\n+    assert_eq!(c.strides(), &[3, 2]);\n+    assert_eq!(co.strides(), &[2, 1]);\n+    assert_eq!(c.shape(), co.shape());\n+    itertools::assert_equal(c.iter(), co.iter());","path":"tests/array.rs","position":121,"original_position":121,"commit_id":"06dfc06a3d68a3e89c6a530ae4d8ff62a167c3bd","original_commit_id":"06dfc06a3d68a3e89c6a530ae4d8ff62a167c3bd","user":{"login":"ExpHP","id":1411280,"avatar_url":"https://avatars0.githubusercontent.com/u/1411280?v=4","gravatar_id":"","url":"https://api.github.com/users/ExpHP","html_url":"https://github.com/ExpHP","followers_url":"https://api.github.com/users/ExpHP/followers","following_url":"https://api.github.com/users/ExpHP/following{/other_user}","gists_url":"https://api.github.com/users/ExpHP/gists{/gist_id}","starred_url":"https://api.github.com/users/ExpHP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ExpHP/subscriptions","organizations_url":"https://api.github.com/users/ExpHP/orgs","repos_url":"https://api.github.com/users/ExpHP/repos","events_url":"https://api.github.com/users/ExpHP/events{/privacy}","received_events_url":"https://api.github.com/users/ExpHP/received_events","type":"User","site_admin":false},"body":"No reason, I think I was just confused and thought PartialEq would check strides for some reason","created_at":"2018-05-03T21:29:25Z","updated_at":"2018-05-03T21:29:25Z","html_url":"https://github.com/bluss/ndarray/pull/444#discussion_r185941721","pull_request_url":"https://api.github.com/repos/bluss/ndarray/pulls/444","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/bluss/ndarray/pulls/comments/185941721"},"html":{"href":"https://github.com/bluss/ndarray/pull/444#discussion_r185941721"},"pull_request":{"href":"https://api.github.com/repos/bluss/ndarray/pulls/444"}},"in_reply_to_id":185931765},"pull_request":{"url":"https://api.github.com/repos/bluss/ndarray/pulls/444","id":184803328,"html_url":"https://github.com/bluss/ndarray/pull/444","diff_url":"https://github.com/bluss/ndarray/pull/444.diff","patch_url":"https://github.com/bluss/ndarray/pull/444.patch","issue_url":"https://api.github.com/repos/bluss/ndarray/issues/444","number":444,"state":"open","locked":false,"title":"add tests with discontiguous owned data","user":{"login":"ExpHP","id":1411280,"avatar_url":"https://avatars0.githubusercontent.com/u/1411280?v=4","gravatar_id":"","url":"https://api.github.com/users/ExpHP","html_url":"https://github.com/ExpHP","followers_url":"https://api.github.com/users/ExpHP/followers","following_url":"https://api.github.com/users/ExpHP/following{/other_user}","gists_url":"https://api.github.com/users/ExpHP/gists{/gist_id}","starred_url":"https://api.github.com/users/ExpHP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ExpHP/subscriptions","organizations_url":"https://api.github.com/users/ExpHP/orgs","repos_url":"https://api.github.com/users/ExpHP/repos","events_url":"https://api.github.com/users/ExpHP/events{/privacy}","received_events_url":"https://api.github.com/users/ExpHP/received_events","type":"User","site_admin":false},"body":"Sprinkle about a couple of tests that produce discontiguous owned arrays, including one RcArray.  I figured there's no need for the tests to be that intensive, because ndarray handles ownership entirely orthogonally to slicing/strides; but anything is better than nothing.\r\n\r\nThis also adds a smoke test for `Drop` data.  Given that ndarray never manually impls `Drop` and that all usages of `forget` and unsafe `std::ptr` methods easily fit in a screenful of grep output[^1], there's little reason to believe this test should fail; but it does give bragging rights.\r\n\r\n---\r\n\r\n[^1] I'll note there was *one* call to `ptr::write` in `from_shape_fn` that made me give a double take before finally concluding that it was panic safe.  Maybe that is what deserves to be tested instead...","created_at":"2018-04-28T20:09:18Z","updated_at":"2018-05-03T21:29:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"050b4d9dbfdc1e99c28d13140bc60ba86159122e","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/bluss/ndarray/pulls/444/commits","review_comments_url":"https://api.github.com/repos/bluss/ndarray/pulls/444/comments","review_comment_url":"https://api.github.com/repos/bluss/ndarray/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bluss/ndarray/issues/444/comments","statuses_url":"https://api.github.com/repos/bluss/ndarray/statuses/06dfc06a3d68a3e89c6a530ae4d8ff62a167c3bd","head":{"label":"ExpHP:owned-strided-tests","ref":"owned-strided-tests","sha":"06dfc06a3d68a3e89c6a530ae4d8ff62a167c3bd","user":{"login":"ExpHP","id":1411280,"avatar_url":"https://avatars0.githubusercontent.com/u/1411280?v=4","gravatar_id":"","url":"https://api.github.com/users/ExpHP","html_url":"https://github.com/ExpHP","followers_url":"https://api.github.com/users/ExpHP/followers","following_url":"https://api.github.com/users/ExpHP/following{/other_user}","gists_url":"https://api.github.com/users/ExpHP/gists{/gist_id}","starred_url":"https://api.github.com/users/ExpHP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ExpHP/subscriptions","organizations_url":"https://api.github.com/users/ExpHP/orgs","repos_url":"https://api.github.com/users/ExpHP/repos","events_url":"https://api.github.com/users/ExpHP/events{/privacy}","received_events_url":"https://api.github.com/users/ExpHP/received_events","type":"User","site_admin":false},"repo":{"id":131438060,"name":"ndarray","full_name":"ExpHP/ndarray","owner":{"login":"ExpHP","id":1411280,"avatar_url":"https://avatars0.githubusercontent.com/u/1411280?v=4","gravatar_id":"","url":"https://api.github.com/users/ExpHP","html_url":"https://github.com/ExpHP","followers_url":"https://api.github.com/users/ExpHP/followers","following_url":"https://api.github.com/users/ExpHP/following{/other_user}","gists_url":"https://api.github.com/users/ExpHP/gists{/gist_id}","starred_url":"https://api.github.com/users/ExpHP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ExpHP/subscriptions","organizations_url":"https://api.github.com/users/ExpHP/orgs","repos_url":"https://api.github.com/users/ExpHP/repos","events_url":"https://api.github.com/users/ExpHP/events{/privacy}","received_events_url":"https://api.github.com/users/ExpHP/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ExpHP/ndarray","description":"ndarray: an N-dimensional array with array views, multidimensional slicing, and efficient operations","fork":true,"url":"https://api.github.com/repos/ExpHP/ndarray","forks_url":"https://api.github.com/repos/ExpHP/ndarray/forks","keys_url":"https://api.github.com/repos/ExpHP/ndarray/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ExpHP/ndarray/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ExpHP/ndarray/teams","hooks_url":"https://api.github.com/repos/ExpHP/ndarray/hooks","issue_events_url":"https://api.github.com/repos/ExpHP/ndarray/issues/events{/number}","events_url":"https://api.github.com/repos/ExpHP/ndarray/events","assignees_url":"https://api.github.com/repos/ExpHP/ndarray/assignees{/user}","branches_url":"https://api.github.com/repos/ExpHP/ndarray/branches{/branch}","tags_url":"https://api.github.com/repos/ExpHP/ndarray/tags","blobs_url":"https://api.github.com/repos/ExpHP/ndarray/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ExpHP/ndarray/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ExpHP/ndarray/git/refs{/sha}","trees_url":"https://api.github.com/repos/ExpHP/ndarray/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ExpHP/ndarray/statuses/{sha}","languages_url":"https://api.github.com/repos/ExpHP/ndarray/languages","stargazers_url":"https://api.github.com/repos/ExpHP/ndarray/stargazers","contributors_url":"https://api.github.com/repos/ExpHP/ndarray/contributors","subscribers_url":"https://api.github.com/repos/ExpHP/ndarray/subscribers","subscription_url":"https://api.github.com/repos/ExpHP/ndarray/subscription","commits_url":"https://api.github.com/repos/ExpHP/ndarray/commits{/sha}","git_commits_url":"https://api.github.com/repos/ExpHP/ndarray/git/commits{/sha}","comments_url":"https://api.github.com/repos/ExpHP/ndarray/comments{/number}","issue_comment_url":"https://api.github.com/repos/ExpHP/ndarray/issues/comments{/number}","contents_url":"https://api.github.com/repos/ExpHP/ndarray/contents/{+path}","compare_url":"https://api.github.com/repos/ExpHP/ndarray/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ExpHP/ndarray/merges","archive_url":"https://api.github.com/repos/ExpHP/ndarray/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ExpHP/ndarray/downloads","issues_url":"https://api.github.com/repos/ExpHP/ndarray/issues{/number}","pulls_url":"https://api.github.com/repos/ExpHP/ndarray/pulls{/number}","milestones_url":"https://api.github.com/repos/ExpHP/ndarray/milestones{/number}","notifications_url":"https://api.github.com/repos/ExpHP/ndarray/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ExpHP/ndarray/labels{/name}","releases_url":"https://api.github.com/repos/ExpHP/ndarray/releases{/id}","deployments_url":"https://api.github.com/repos/ExpHP/ndarray/deployments","created_at":"2018-04-28T19:28:05Z","updated_at":"2018-04-28T19:28:07Z","pushed_at":"2018-04-28T19:28:28Z","git_url":"git://github.com/ExpHP/ndarray.git","ssh_url":"git@github.com:ExpHP/ndarray.git","clone_url":"https://github.com/ExpHP/ndarray.git","svn_url":"https://github.com/ExpHP/ndarray","homepage":"https://docs.rs/ndarray/","size":4046,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"bluss:master","ref":"master","sha":"9f18d6f9befd32c629da661cead1b501f5639b70","user":{"login":"bluss","id":3209739,"avatar_url":"https://avatars1.githubusercontent.com/u/3209739?v=4","gravatar_id":"","url":"https://api.github.com/users/bluss","html_url":"https://github.com/bluss","followers_url":"https://api.github.com/users/bluss/followers","following_url":"https://api.github.com/users/bluss/following{/other_user}","gists_url":"https://api.github.com/users/bluss/gists{/gist_id}","starred_url":"https://api.github.com/users/bluss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bluss/subscriptions","organizations_url":"https://api.github.com/users/bluss/orgs","repos_url":"https://api.github.com/users/bluss/repos","events_url":"https://api.github.com/users/bluss/events{/privacy}","received_events_url":"https://api.github.com/users/bluss/received_events","type":"User","site_admin":false},"repo":{"id":22598813,"name":"ndarray","full_name":"bluss/ndarray","owner":{"login":"bluss","id":3209739,"avatar_url":"https://avatars1.githubusercontent.com/u/3209739?v=4","gravatar_id":"","url":"https://api.github.com/users/bluss","html_url":"https://github.com/bluss","followers_url":"https://api.github.com/users/bluss/followers","following_url":"https://api.github.com/users/bluss/following{/other_user}","gists_url":"https://api.github.com/users/bluss/gists{/gist_id}","starred_url":"https://api.github.com/users/bluss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bluss/subscriptions","organizations_url":"https://api.github.com/users/bluss/orgs","repos_url":"https://api.github.com/users/bluss/repos","events_url":"https://api.github.com/users/bluss/events{/privacy}","received_events_url":"https://api.github.com/users/bluss/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bluss/ndarray","description":"ndarray: an N-dimensional array with array views, multidimensional slicing, and efficient operations","fork":false,"url":"https://api.github.com/repos/bluss/ndarray","forks_url":"https://api.github.com/repos/bluss/ndarray/forks","keys_url":"https://api.github.com/repos/bluss/ndarray/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bluss/ndarray/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bluss/ndarray/teams","hooks_url":"https://api.github.com/repos/bluss/ndarray/hooks","issue_events_url":"https://api.github.com/repos/bluss/ndarray/issues/events{/number}","events_url":"https://api.github.com/repos/bluss/ndarray/events","assignees_url":"https://api.github.com/repos/bluss/ndarray/assignees{/user}","branches_url":"https://api.github.com/repos/bluss/ndarray/branches{/branch}","tags_url":"https://api.github.com/repos/bluss/ndarray/tags","blobs_url":"https://api.github.com/repos/bluss/ndarray/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bluss/ndarray/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bluss/ndarray/git/refs{/sha}","trees_url":"https://api.github.com/repos/bluss/ndarray/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bluss/ndarray/statuses/{sha}","languages_url":"https://api.github.com/repos/bluss/ndarray/languages","stargazers_url":"https://api.github.com/repos/bluss/ndarray/stargazers","contributors_url":"https://api.github.com/repos/bluss/ndarray/contributors","subscribers_url":"https://api.github.com/repos/bluss/ndarray/subscribers","subscription_url":"https://api.github.com/repos/bluss/ndarray/subscription","commits_url":"https://api.github.com/repos/bluss/ndarray/commits{/sha}","git_commits_url":"https://api.github.com/repos/bluss/ndarray/git/commits{/sha}","comments_url":"https://api.github.com/repos/bluss/ndarray/comments{/number}","issue_comment_url":"https://api.github.com/repos/bluss/ndarray/issues/comments{/number}","contents_url":"https://api.github.com/repos/bluss/ndarray/contents/{+path}","compare_url":"https://api.github.com/repos/bluss/ndarray/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bluss/ndarray/merges","archive_url":"https://api.github.com/repos/bluss/ndarray/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bluss/ndarray/downloads","issues_url":"https://api.github.com/repos/bluss/ndarray/issues{/number}","pulls_url":"https://api.github.com/repos/bluss/ndarray/pulls{/number}","milestones_url":"https://api.github.com/repos/bluss/ndarray/milestones{/number}","notifications_url":"https://api.github.com/repos/bluss/ndarray/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bluss/ndarray/labels{/name}","releases_url":"https://api.github.com/repos/bluss/ndarray/releases{/id}","deployments_url":"https://api.github.com/repos/bluss/ndarray/deployments","created_at":"2014-08-04T09:27:53Z","updated_at":"2018-05-02T19:39:28Z","pushed_at":"2018-05-01T06:01:29Z","git_url":"git://github.com/bluss/ndarray.git","ssh_url":"git@github.com:bluss/ndarray.git","clone_url":"https://github.com/bluss/ndarray.git","svn_url":"https://github.com/bluss/ndarray","homepage":"https://docs.rs/ndarray/","size":4045,"stargazers_count":501,"watchers_count":501,"language":"Rust","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":63,"mirror_url":null,"archived":false,"open_issues_count":74,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":63,"open_issues":74,"watchers":501,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bluss/ndarray/pulls/444"},"html":{"href":"https://github.com/bluss/ndarray/pull/444"},"issue":{"href":"https://api.github.com/repos/bluss/ndarray/issues/444"},"comments":{"href":"https://api.github.com/repos/bluss/ndarray/issues/444/comments"},"review_comments":{"href":"https://api.github.com/repos/bluss/ndarray/pulls/444/comments"},"review_comment":{"href":"https://api.github.com/repos/bluss/ndarray/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bluss/ndarray/pulls/444/commits"},"statuses":{"href":"https://api.github.com/repos/bluss/ndarray/statuses/06dfc06a3d68a3e89c6a530ae4d8ff62a167c3bd"}},"author_association":"NONE"}}
{"actor":{"display_login":"ExpHP"}}