{"action":"opened","issue":{"url":"https://api.github.com/repos/restic/restic/issues/774","repository_url":"https://api.github.com/repos/restic/restic","labels_url":"https://api.github.com/repos/restic/restic/issues/774/labels{/name}","comments_url":"https://api.github.com/repos/restic/restic/issues/774/comments","events_url":"https://api.github.com/repos/restic/restic/issues/774/events","html_url":"https://github.com/restic/restic/issues/774","id":205352174,"number":774,"title":"Test TestNodeComparison tree_test.go not clear","user":{"login":"jgfrm","id":15730384,"avatar_url":"https://avatars.githubusercontent.com/u/15730384?v=3","gravatar_id":"","url":"https://api.github.com/users/jgfrm","html_url":"https://github.com/jgfrm","followers_url":"https://api.github.com/users/jgfrm/followers","following_url":"https://api.github.com/users/jgfrm/following{/other_user}","gists_url":"https://api.github.com/users/jgfrm/gists{/gist_id}","starred_url":"https://api.github.com/users/jgfrm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgfrm/subscriptions","organizations_url":"https://api.github.com/users/jgfrm/orgs","repos_url":"https://api.github.com/users/jgfrm/repos","events_url":"https://api.github.com/users/jgfrm/events{/privacy}","received_events_url":"https://api.github.com/users/jgfrm/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-02-04T14:55:27Z","updated_at":"2017-02-04T14:55:27Z","closed_at":null,"body":"Can someone explain me the following test code (file tree_test.go):\r\n\r\n`\r\nfunc TestNodeComparison(t *testing.T) {\r\n\tfi, err := os.Lstat(\"tree_test.go\")\r\n\tOK(t, err)\r\n\r\n\tnode, err := restic.NodeFromFileInfo(\"foo\", fi)\r\n\tOK(t, err)\r\n\r\n\tn2 := *node\r\n\tAssert(t, node.Equals(n2), \"nodes aren't equal\")\r\n\r\n\tn2.Size--\r\n\tAssert(t, !node.Equals(n2), \"nodes are equal\")\r\n}\r\n`\r\n\r\nTo supported extended atributes, \r\n`NodeFromFileInfo'\r\ncalls a function to read the extended attributes of a file\r\nFor \r\n`foo`\r\nthe test fails.\r\n\r\nWhat is not clear to me:\r\n\r\n1. \r\n`\r\nfi, err := os.Lstat(\"tree_test.go\")\r\n\tOK(t, err)\r\n'\r\nWhy passed the above code the test? I would say the file tree_test.go is not present on the filesystem (at least in the dir the test is run.\r\n\r\n2. My code really needs to access the file having the extended attributes exposed. The test code passes the LStat info to NodeFromFileInfo, and that code does not access the file (but only the LStat info). Therefore my question is if this should be revised for the case of extended attributes?\r\n\r\n"}}
{"actor":{"display_login":"jgfrm"}}