{"action":"created","issue":{"url":"https://api.github.com/repos/dart-lang/test/issues/183","labels_url":"https://api.github.com/repos/dart-lang/test/issues/183/labels{/name}","comments_url":"https://api.github.com/repos/dart-lang/test/issues/183/comments","events_url":"https://api.github.com/repos/dart-lang/test/issues/183/events","html_url":"https://github.com/dart-lang/test/issues/183","id":85654918,"number":183,"title":"Please update isEmpty matcher to use Iterable","user":{"login":"DartBot","id":8958862,"avatar_url":"https://avatars.githubusercontent.com/u/8958862?v=3","gravatar_id":"","url":"https://api.github.com/users/DartBot","html_url":"https://github.com/DartBot","followers_url":"https://api.github.com/users/DartBot/followers","following_url":"https://api.github.com/users/DartBot/following{/other_user}","gists_url":"https://api.github.com/users/DartBot/gists{/gist_id}","starred_url":"https://api.github.com/users/DartBot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DartBot/subscriptions","organizations_url":"https://api.github.com/users/DartBot/orgs","repos_url":"https://api.github.com/users/DartBot/repos","events_url":"https://api.github.com/users/DartBot/events{/privacy}","received_events_url":"https://api.github.com/users/DartBot/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dart-lang/test/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/dart-lang/test/labels/Fixed","name":"Fixed","color":"ededed"},{"url":"https://api.github.com/repos/dart-lang/test/labels/Priority-Medium","name":"Priority-Medium","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-06-05T23:18:19Z","updated_at":"2015-06-05T23:18:20Z","closed_at":null,"body":"<a href=\"https://github.com/sethladd\"><img src=\"https://avatars.githubusercontent.com/u/5479?v=3\" align=\"left\" width=\"96\" height=\"96\"hspace=\"10\"></img></a> **Issue by [sethladd](https://github.com/sethladd)**\n_Originally opened as dart-lang/sdk#8159_\n\n----\n\nI saw the isEmpty matcher, which has no docs, and I was hoping it checked if an iterable is empty. Unfortunately, it only works with maps, collections, or strings. Now, with lib v2, there are more things that use Iterable.\n\nisEmpty: http://api.dartlang.org/docs/bleeding_edge/matcher.html#isEmpty\n\nConsider this code:\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;test('keys is empty', () {\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var future = store.keys();\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;expect(future, completion(isEmpty));\n//        future.then((keys) {\n//          expect(keys.length, 0);\n//        });\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});\n\nThis actually fails with this error:\n\nmemory with no values keys is empty. Expected: empty but: was &lt;Instance of '_HashMapImplKeyIterable@0x36924d72&lt;String&gt;'&gt;.\n\nThe implementation of isEmpty is:\n\nconst Matcher isEmpty = const \\_Empty();\n\nclass \\_Empty extends BaseMatcher {\n&nbsp;&nbsp;const \\_Empty();\n&nbsp;&nbsp;bool matches(item, MatchState matchState) {\n&nbsp;&nbsp;&nbsp;&nbsp;if (item is Map || item is Collection) {\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return item.isEmpty;\n&nbsp;&nbsp;&nbsp;&nbsp;} else if (item is String) {\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return item.length == 0;\n&nbsp;&nbsp;&nbsp;&nbsp;} else {\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return false;\n&nbsp;&nbsp;&nbsp;&nbsp;}\n&nbsp;&nbsp;}\n&nbsp;&nbsp;Description describe(Description description) =&gt;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;description.add('empty');\n}\n\n"},"comment":{"url":"https://api.github.com/repos/dart-lang/test/issues/comments/109478836","html_url":"https://github.com/dart-lang/test/issues/183#issuecomment-109478836","issue_url":"https://api.github.com/repos/dart-lang/test/issues/183","id":109478836,"user":{"login":"DartBot","id":8958862,"avatar_url":"https://avatars.githubusercontent.com/u/8958862?v=3","gravatar_id":"","url":"https://api.github.com/users/DartBot","html_url":"https://github.com/DartBot","followers_url":"https://api.github.com/users/DartBot/followers","following_url":"https://api.github.com/users/DartBot/following{/other_user}","gists_url":"https://api.github.com/users/DartBot/gists{/gist_id}","starred_url":"https://api.github.com/users/DartBot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DartBot/subscriptions","organizations_url":"https://api.github.com/users/DartBot/orgs","repos_url":"https://api.github.com/users/DartBot/repos","events_url":"https://api.github.com/users/DartBot/events{/privacy}","received_events_url":"https://api.github.com/users/DartBot/received_events","type":"User","site_admin":false},"created_at":"2015-06-05T23:18:20Z","updated_at":"2015-06-05T23:18:20Z","body":"<a href=\"https://github.com/sethladd\"><img src=\"https://avatars.githubusercontent.com/u/5479?v=3\" align=\"left\" width=\"48\" height=\"48\"hspace=\"10\"></img></a> **Comment by [sethladd](https://github.com/sethladd)**\n\n----\n\nI ran into this again. With more interfaces changing to Iterable, I think it would be helpful to have this change.\n\nThanks!\n______\n*Set owner to @gramster.*\n"}}