Skip to content

'Diamond' test run fails without error message #36

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ThorstenReichert opened this issue Nov 5, 2021 · 3 comments · Fixed by #53
Closed

'Diamond' test run fails without error message #36

ThorstenReichert opened this issue Nov 5, 2021 · 3 comments · Fixed by #53

Comments

@ThorstenReichert
Copy link

For the Diamond exercise in F#, the submission below fails with an empty error message, stating only "We received the following error when we ran your code", but no actual reason.

image

Looking at the dev console in my browser, I see multiple calls to the "test_run_ endpoint returning

{"test_run":null}

with status 304. If I modify my submission slightly by defining

let space = '.' // instead of let space = ' '

then I receive a "test_run" response with status 200 and some expected test failure messages (after some empty 304s as above).

The code submission:

module Diamond

let alphabet = [|'A'..'Z'|]
let space = ' '

let createUpperHalfRow row size =
    let center = size / 2
    if row = 0 then
        Array.init size (fun i -> if i = center then alphabet.[row] else space)
    else
        Array.init size (fun i -> if i = center - row || i = center + row then alphabet.[row] else space)


let createUpperHalf size =
    Array.init (size / 2 + 1) (fun i -> createUpperHalfRow i size)

let mirrorLowerHalf upperHalf =
    let length = Array.length upperHalf
    Array.init (length - 1) (fun i -> upperHalf.[length - i - 2])

let make letter = 
    let size = (Array.findIndex ((=) letter) alphabet) * 2 + 1
    let upperHalf = createUpperHalf size
    let lowerHalf = mirrorLowerHalf upperHalf

    lowerHalf
    |> Array.append upperHalf
    |> Array.map System.String
    |> String.concat System.Environment.NewLine
@ErikSchierboom
Copy link
Member

See exercism/fsharp#1022

@ErikSchierboom
Copy link
Member

@ThorstenReichert We've just deployed a fix. Could you verify that re-running the tests now works for you?

@ThorstenReichert
Copy link
Author

@ErikSchierboom Works for me, thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants