wolfiton
Koans string problem maybe a bug
I was going though the exercises in http://elixirkoans.io and stumbled upon something odd. even if my code does solve the problem i don’t get a pass.
Exercise:
koan "Be careful, a message may be altered" do
assert String.replace("An awful day", "awful", "incredible") == String.replace("awful","awful","incredible", global: true)
end
Console response
Be careful, a message may be altered
Assertion failed in lib/koans/02_strings.ex:23
assert(String.replace("An awful day", "awful", "incredible") == String.replace("awful", "awful", "incredible", global: true))
left: "An incredible day"
right: "incredible"
The answers they expect can be seen here https://github.com/elixirkoans/elixir-koans/blob/master/test/koans/strings_koan_test.exs and i think is the same thing I am providing.
So why doesn’t my answer get a successful pass?
Thanks
Marked As Solved
wolfiton
Got it! It wanted only the String version of the assertion, in this case “An incredible day”
3
Popular in Challenges
Nobody’s doing Advent of Code this year? :smile:
I might do the first week or so.
For Day 1, first I solved it using regular expression...
New
Note by the Moderators: This topic is to talk about the first day of the Advent of Code.
For general discussion about the Advent of Code...
New
Phew, this one took a while to get right. My naive attempts was way to slow so I reached for Dijkstras shortest path algorithm… and that ...
New
This topic is about Day 18 of the Advent of Code 2021.
We have a private leaderboard (shared with users of Erlang Forums):
https://adve...
New
This one has been quite the ride. Struggled at first to find a good data format to suite the problem. I really like how that turned out b...
New
This topic is about Day 5 of the Advent of Code 2020 .
Thanks to @egze, we have a private leaderboard:
https://adventofcode.com/2020/le...
New
Hey there :wave:
No magic or algorithmic finesse today, I just finished the challenge and I my code is quite slow (1sec for part1, 3se...
New
It is that time of the year again: Advent of Code 2022 :christmas_tree:
Day 1
Leaderboard:
New
Took a while, but another use case for “move vectors” today and pattern matching. :slight_smile:
The trick was to first generate a list...
New
Note: This topic is to talk about Day 6 of the Advent of Code 2019.
There is a private leaderboard for elixirforum members. You can join...
New
Other popular topics
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
New
Hi there,
I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 record...
New
Good day to you all.
I have been struggling to get a query involving like and ilike to work.
Can anyone assist me on this, please?
pro...
New
Hi folks,
Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
New
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine)
This is a plugin that adds support for Elixir to JetBrains IntelliJ...
New
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service.
Currently when I de...
New
As promised, the first release candidate of Phoenix 1.3.0 is out! This release focuses on code generators with improved project structure...
New
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New







