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

AlmostDone/When (step 7) passes test when code isn't correct #238

Open
p3p3fr0g opened this issue Oct 22, 2024 · 0 comments
Open

AlmostDone/When (step 7) passes test when code isn't correct #238

p3p3fr0g opened this issue Oct 22, 2024 · 0 comments

Comments

@p3p3fr0g
Copy link

The following code passes the test at this level

fun applyFilter(picture: String, filterName: String): String {
   var newPicture = trimPicture(picture)
   when (filterName) {
       "borders" -> {applyBordersFilter(newPicture)}
        "squared" -> {applySquaredFilter(newPicture)}
       else -> error("Invalid filter name")
   }
    return newPicture
}

when it needs to be

fun applyFilter(picture: String, filterName: String): String {
    var newPicture = trimPicture(picture)
    newPicture = when (filterName) {
        "borders" -> {applyBordersFilter(newPicture)}
        "squared" -> {applySquaredFilter(newPicture)}
        else -> error("Invalid filter name")
    }
    return newPicture
}

otherwise it causes issues in step 11

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

No branches or pull requests

1 participant