{"action":"closed","issue":{"url":"https://api.github.com/repos/exercism/xfsharp/issues/206","repository_url":"https://api.github.com/repos/exercism/xfsharp","labels_url":"https://api.github.com/repos/exercism/xfsharp/issues/206/labels{/name}","comments_url":"https://api.github.com/repos/exercism/xfsharp/issues/206/comments","events_url":"https://api.github.com/repos/exercism/xfsharp/issues/206/events","html_url":"https://github.com/exercism/xfsharp/issues/206","id":174895044,"number":206,"title":"Tests for all-your-base look wrong","user":{"login":"rmunn","id":90762,"avatar_url":"https://avatars.githubusercontent.com/u/90762?v=3","gravatar_id":"","url":"https://api.github.com/users/rmunn","html_url":"https://github.com/rmunn","followers_url":"https://api.github.com/users/rmunn/followers","following_url":"https://api.github.com/users/rmunn/following{/other_user}","gists_url":"https://api.github.com/users/rmunn/gists{/gist_id}","starred_url":"https://api.github.com/users/rmunn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmunn/subscriptions","organizations_url":"https://api.github.com/users/rmunn/orgs","repos_url":"https://api.github.com/users/rmunn/repos","events_url":"https://api.github.com/users/rmunn/events{/privacy}","received_events_url":"https://api.github.com/users/rmunn/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-09-03T12:42:05Z","updated_at":"2016-09-04T16:17:47Z","closed_at":"2016-09-04T16:17:47Z","body":"I just got the new all-your-base exercise for the first time. And as I was looking through the unit tests to see the spec I'm implementing against, I noticed that an empty list `[]` is considered to be invalid input, rather than 0. That's a debatable issue (and I would disagree), but that's a place where opinion can validly differ -- if you have a string with no digits in it at all, it's fair enough to consider that to be \"not a number\" rather than representing 0, so a list with no digits could also represent 0. It will make my code slightly less elegant than it could have been, but fair enough.\r\n\r\nBut then I saw the next test, where the input is `[0]` and the output is `None`. That one's not debatable; it's just wrong. An input of a single 0 digit should produce the number 0 in the output base, and should not be an error.\r\n\r\nAnd the next two tests after that, where the input is either multiple zeroes (`[0; 0; 0]`) or contains a leading zero (`[0; 6; 0]`), also expect an output of `None`. And here also, I believe the tests are wrong, and the correct answer should be 0, and \"60\" in whatever the input base is (in that particular test it's 7, so `60` is 42 in decimal).\r\n\r\nLooking at https://github.com/exercism/x-common/blob/master/all-your-base.json for a bit, I figured out that the tests were automatically converted to F#, and the `null` results in that JSON file were turned into `None`. But the comment at the top of that JSON file says that it's those are tests where the right behavior could vary by language, and it's up to each language track to determine what the right behavior should be. I.e., they say that the correct representation of zero might be an empty list, or a list with a single zero, or a list with multiple zeroes... and that's why all those tests have a defined result of `null`. But at least *one* of them should be possible; as it stands, the F# version of the all-your-base exercise does not allow zero to be represented at all.\r\n\r\nWhich, in a test that was *named* after Zero Wing, just seems... well, **wrong** somehow.\r\n\r\nThe tests should be fixed... for great justice."}}
{"actor":{"display_login":"ErikSchierboom"}}