{"action":"created","issue":{"url":"https://api.github.com/repos/Kotlin/kotlin-koans/issues/31","labels_url":"https://api.github.com/repos/Kotlin/kotlin-koans/issues/31/labels{/name}","comments_url":"https://api.github.com/repos/Kotlin/kotlin-koans/issues/31/comments","events_url":"https://api.github.com/repos/Kotlin/kotlin-koans/issues/31/events","html_url":"https://github.com/Kotlin/kotlin-koans/issues/31","id":115895910,"number":31,"title":"Collections/Fold test on try.kotlinlang.org is incorrect","user":{"login":"MaXal","id":266747,"avatar_url":"https://avatars.githubusercontent.com/u/266747?v=3","gravatar_id":"","url":"https://api.github.com/users/MaXal","html_url":"https://github.com/MaXal","followers_url":"https://api.github.com/users/MaXal/followers","following_url":"https://api.github.com/users/MaXal/following{/other_user}","gists_url":"https://api.github.com/users/MaXal/gists{/gist_id}","starred_url":"https://api.github.com/users/MaXal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MaXal/subscriptions","organizations_url":"https://api.github.com/users/MaXal/orgs","repos_url":"https://api.github.com/users/MaXal/repos","events_url":"https://api.github.com/users/MaXal/events{/privacy}","received_events_url":"https://api.github.com/users/MaXal/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-09T15:07:33Z","updated_at":"2015-11-18T18:43:05Z","closed_at":"2015-11-18T18:43:05Z","body":"On http://try.kotlinlang.org/ looks like Collections/Fold test is incorrect.\r\n\r\nThe following code is not acceptied:\r\n```\r\n// Return the set of products that were ordered by every customer\r\nfun Shop.getProductsOrderedByAllCustomers(): Set<Product> = customers.fold(emptySet(), {\r\n    partProduct, element ->\r\n    partProduct + element.orders.flatMap { it.products}\r\n})\r\n```\r\n\r\nand the test fails with the following message:\r\n```\r\njava.lang.AssertionError: \r\n\r\nExpected: ['IntelliJ IDEA Ultimate' for 199.0]\r\nActual: ['IntelliJ IDEA Ultimate' for 199.0, 'WebStorm' for 49.0, 'YouTrack' for 500.0]\r\n    <click to see a difference>\r\n\r\n    at org.junit.Assert.fail(Assert.java:93)\r\n    at org.junit.Assert.failNotEquals(Assert.java:647)\r\n    at org.junit.Assert.assertEquals(Assert.java:128)\r\n    at org.junit.Assert.assertEquals(Assert.java:147)\r\n    at TestFold.testGetProductsOrderedByAllCustomers(Test.kt:16)\r\n```\r\n\r\nThe test looks invalid:\r\n```\r\nAssert.assertEquals(setOf(idea), testShop.getProductsOrderedByAllCustomers())\r\n```\r\nsince according to description the set should contain all products from all customers."},"comment":{"url":"https://api.github.com/repos/Kotlin/kotlin-koans/issues/comments/157816013","html_url":"https://github.com/Kotlin/kotlin-koans/issues/31#issuecomment-157816013","issue_url":"https://api.github.com/repos/Kotlin/kotlin-koans/issues/31","id":157816013,"user":{"login":"svtk","id":1447386,"avatar_url":"https://avatars.githubusercontent.com/u/1447386?v=3","gravatar_id":"","url":"https://api.github.com/users/svtk","html_url":"https://github.com/svtk","followers_url":"https://api.github.com/users/svtk/followers","following_url":"https://api.github.com/users/svtk/following{/other_user}","gists_url":"https://api.github.com/users/svtk/gists{/gist_id}","starred_url":"https://api.github.com/users/svtk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svtk/subscriptions","organizations_url":"https://api.github.com/users/svtk/orgs","repos_url":"https://api.github.com/users/svtk/repos","events_url":"https://api.github.com/users/svtk/events{/privacy}","received_events_url":"https://api.github.com/users/svtk/received_events","type":"User","site_admin":false},"created_at":"2015-11-18T18:43:05Z","updated_at":"2015-11-18T18:43:05Z","body":"Thanks! The function name was indeed ambiguous, so I renamed the function to 'getSetOfProductsOrderedByEveryCustomer'. In this case the test is correct."}}