Skip to content
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

Tests on poemWriter throw false positves #10

Closed
jminterwebs opened this issue Jul 4, 2017 · 2 comments
Closed

Tests on poemWriter throw false positves #10

jminterwebs opened this issue Jul 4, 2017 · 2 comments
Assignees
Labels

Comments

@jminterwebs
Copy link

jminterwebs commented Jul 4, 2017

@gj

It is possible to pass all the test yet crash the server one using the poemWriter a second time.

On solutions that do not check to see with the poem is three lines long before validating the amount of word per line. So on any poem tested after the first initial poem the server will crash when code simillar to this is ran

`function countWords(line) {
return line.split(' ').filter(l => l).length;
}

function isValidPoem(poem) {
const poemLines = poem.split('\n').filter(l => l);
const isRightAmountOfLines = poemLines.length === 3;
const hasRightAmountOfWords = countWords(poemLines[0]) === 5 && countWords(poemLines[1]) === 3 && countWords(poemLines[2]) === 5;
return isRightAmountOfLines && hasRightAmountOfWords;
}`

It seems when poem is passed the second time it has now length therefore crashing the server.

@gj
Copy link
Contributor

gj commented Jul 5, 2017

Hi @jminterwebs !

Would you mind including a stack trace of the error(s) you're seeing?

@realAndrewCohn
Copy link
Contributor

The tests and solution branch have now been updated for this lab. closing issue

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

No branches or pull requests

5 participants
@jminterwebs @Lukeghenco @gj @realAndrewCohn and others