{"action":"created","issue":{"url":"https://api.github.com/repos/ponylang/ponyc/issues/577","repository_url":"https://api.github.com/repos/ponylang/ponyc","labels_url":"https://api.github.com/repos/ponylang/ponyc/issues/577/labels{/name}","comments_url":"https://api.github.com/repos/ponylang/ponyc/issues/577/comments","events_url":"https://api.github.com/repos/ponylang/ponyc/issues/577/events","html_url":"https://github.com/ponylang/ponyc/issues/577","id":140081795,"number":577,"title":"String::count(s: String box, offset: ISize = 0): USize returns the wrong value if there are two substring matches at the end of the string","user":{"login":"aturley","id":714337,"avatar_url":"https://avatars.githubusercontent.com/u/714337?v=3","gravatar_id":"","url":"https://api.github.com/users/aturley","html_url":"https://github.com/aturley","followers_url":"https://api.github.com/users/aturley/followers","following_url":"https://api.github.com/users/aturley/following{/other_user}","gists_url":"https://api.github.com/users/aturley/gists{/gist_id}","starred_url":"https://api.github.com/users/aturley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aturley/subscriptions","organizations_url":"https://api.github.com/users/aturley/orgs","repos_url":"https://api.github.com/users/aturley/repos","events_url":"https://api.github.com/users/aturley/events{/privacy}","received_events_url":"https://api.github.com/users/aturley/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-11T04:19:55Z","updated_at":"2016-03-11T08:08:31Z","closed_at":null,"body":"# Expected Behavior\r\n\r\nExpect the following assertion to be true:\r\n\r\n```\r\nh.assert_eq[USize](3, \"///\".count(\"/\"))\r\n```\r\n\r\n# Actual Behavior\r\n\r\nInstead, the following assertion is true:\r\n\r\n```\r\nh.assert_eq[USize](2, \"///\".count(\"/\"))\r\n```\r\n\r\nBut this assertion is also true:\r\n\r\n```\r\nh.assert_eq[USize](3, \"//a/\".count(\"/\"))\r\n```\r\n\r\n# Additional Information\r\n\r\nIt looks like the problem is [here](https://github.com/ponylang/ponyc/blob/master/packages/builtin/string.pony#L414), where the condition is `k < j` when I believe it should be `k <= j`."},"comment":{"url":"https://api.github.com/repos/ponylang/ponyc/issues/comments/195246768","html_url":"https://github.com/ponylang/ponyc/issues/577#issuecomment-195246768","issue_url":"https://api.github.com/repos/ponylang/ponyc/issues/577","id":195246768,"user":{"login":"jonas-l","id":392238,"avatar_url":"https://avatars.githubusercontent.com/u/392238?v=3","gravatar_id":"","url":"https://api.github.com/users/jonas-l","html_url":"https://github.com/jonas-l","followers_url":"https://api.github.com/users/jonas-l/followers","following_url":"https://api.github.com/users/jonas-l/following{/other_user}","gists_url":"https://api.github.com/users/jonas-l/gists{/gist_id}","starred_url":"https://api.github.com/users/jonas-l/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonas-l/subscriptions","organizations_url":"https://api.github.com/users/jonas-l/orgs","repos_url":"https://api.github.com/users/jonas-l/repos","events_url":"https://api.github.com/users/jonas-l/events{/privacy}","received_events_url":"https://api.github.com/users/jonas-l/received_events","type":"User","site_admin":false},"created_at":"2016-03-11T08:08:31Z","updated_at":"2016-03-11T08:08:31Z","body":"Write a few [test cases][1] for `String.count()` and your first contribution to Pony is ready!\r\n\r\n[1]: https://github.com/ponylang/ponyc/blob/master/packages/builtin_test/test.pony"}}