{"action":"created","issue":{"url":"https://api.github.com/repos/go-hep/hep/issues/164","repository_url":"https://api.github.com/repos/go-hep/hep","labels_url":"https://api.github.com/repos/go-hep/hep/issues/164/labels{/name}","comments_url":"https://api.github.com/repos/go-hep/hep/issues/164/comments","events_url":"https://api.github.com/repos/go-hep/hep/issues/164/events","html_url":"https://github.com/go-hep/hep/pull/164","id":316232772,"number":164,"title":"Rootio tchain scanner","user":{"login":"maloft","id":38098030,"avatar_url":"https://avatars1.githubusercontent.com/u/38098030?v=4","gravatar_id":"","url":"https://api.github.com/users/maloft","html_url":"https://github.com/maloft","followers_url":"https://api.github.com/users/maloft/followers","following_url":"https://api.github.com/users/maloft/following{/other_user}","gists_url":"https://api.github.com/users/maloft/gists{/gist_id}","starred_url":"https://api.github.com/users/maloft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maloft/subscriptions","organizations_url":"https://api.github.com/users/maloft/orgs","repos_url":"https://api.github.com/users/maloft/repos","events_url":"https://api.github.com/users/maloft/events{/privacy}","received_events_url":"https://api.github.com/users/maloft/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-04-20T11:34:45Z","updated_at":"2018-05-14T10:28:11Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/go-hep/hep/pulls/164","html_url":"https://github.com/go-hep/hep/pull/164","diff_url":"https://github.com/go-hep/hep/pull/164.diff","patch_url":"https://github.com/go-hep/hep/pull/164.patch"},"body":""},"comment":{"url":"https://api.github.com/repos/go-hep/hep/issues/comments/388770761","html_url":"https://github.com/go-hep/hep/pull/164#issuecomment-388770761","issue_url":"https://api.github.com/repos/go-hep/hep/issues/164","id":388770761,"user":{"login":"sbinet","id":1070920,"avatar_url":"https://avatars2.githubusercontent.com/u/1070920?v=4","gravatar_id":"","url":"https://api.github.com/users/sbinet","html_url":"https://github.com/sbinet","followers_url":"https://api.github.com/users/sbinet/followers","following_url":"https://api.github.com/users/sbinet/following{/other_user}","gists_url":"https://api.github.com/users/sbinet/gists{/gist_id}","starred_url":"https://api.github.com/users/sbinet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbinet/subscriptions","organizations_url":"https://api.github.com/users/sbinet/orgs","repos_url":"https://api.github.com/users/sbinet/repos","events_url":"https://api.github.com/users/sbinet/events{/privacy}","received_events_url":"https://api.github.com/users/sbinet/received_events","type":"User","site_admin":false},"created_at":"2018-05-14T10:28:11Z","updated_at":"2018-05-14T10:28:11Z","author_association":"OWNER","body":"it's getting there, but it seems the scanner doesn't cross `Tree` boundaries, ie: it only iterates on the first tree of the chain and doesn't go to the next.\r\n\r\nin other words, if I change the test like so:\r\n```diff\r\ndiff --git a/rootio/tchain_test.go b/rootio/tchain_test.go\r\nindex e50196e..1bf46bf 100644\r\n--- a/rootio/tchain_test.go\r\n+++ b/rootio/tchain_test.go\r\n@@ -85,10 +85,12 @@ func TestChain(t *testing.T) {\r\n func TestChainScan(t *testing.T) {\r\n        files := []string{\r\n                \"testdata/chain.1.root\",\r\n-               \"testdata/chain.2.root\", // FIXME(sbinet): implement for >1 tree\r\n+               \"testdata/chain.2.root\",\r\n                \"testdata/chain.1.root\",\r\n                \"testdata/chain.2.root\",\r\n        }\r\n+\r\n+       var wantTotal int64\r\n        trees := make([]rootio.Tree, len(files))\r\n        for i, fname := range files {\r\n                f, err := rootio.Open(fname)\r\n@@ -103,6 +105,7 @@ func TestChainScan(t *testing.T) {\r\n                }\r\n \r\n                trees[i] = obj.(rootio.Tree)\r\n+               wantTotal += trees[i].Entries()\r\n        }\r\n        chain := rootio.Chain(trees...)\r\n        type Data struct {\r\n@@ -147,6 +150,7 @@ func TestChainScan(t *testing.T) {\r\n        }\r\n        defer sc.Close()\r\n \r\n+       var total int64\r\n        for sc.Next() {\r\n                var d1 Data\r\n                err := sc.Scan(&d1)\r\n@@ -166,9 +170,13 @@ func TestChainScan(t *testing.T) {\r\n                if !reflect.DeepEqual(d2, want(i)) {\r\n                        t.Fatalf(\"entry[%d]:\\ngot= %#v\\nwant=%#v\\n\", i, d2, want(i))\r\n                }\r\n+               total++\r\n        }\r\n        if err := sc.Err(); err != nil && err != io.EOF {\r\n                t.Fatal(err)\r\n        }\r\n \r\n+       if total != wantTotal {\r\n+               t.Fatalf(\"scanned %d entries. want %d\", total, wantTotal)\r\n+       }\r\n }\r\n```\r\n\r\nit fails with:\r\n```\r\n=== RUN   TestChainScan\r\n--- FAIL: TestChainScan (0.00s)\r\n\ttchain_test.go:180: scanned 10 entries. want 40\r\n```"}}
{"actor":{"display_login":"sbinet"}}