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 elixir-koans/test/koans/strings_koan_test.exs at master · elixirkoans/elixir-koans · GitHub 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
Finished Day 1 with Elixir :tada:
Here’s my code:
#!/usr/bin/env elixir
defmodule Combination do
@doc "Yields each combination of 2...
New
This topic is about Day 4 of the Advent of Code 2020 .
Thanks to @egze, we have a private leaderboard:
https://adventofcode.com/2020/le...
New
Today’s challenge for me was about using reduce:
defmodule Prob5 do
def move([[h1 | rest] = _list1, list2]) do
[rest, [h1 | list2]...
New
Monkeys fitted squarely as GenServers in my head. My initial problem was using cast instead of call; I imagine impolite monkeys slinging...
New
Don’t know why the regex ~r/[\W && [^\.]]/x does not work in Elixir. It works pretty well in Ruby.
Anyway, here is my solution: ...
New
The second part of today’s puzzle is very misleading.
FYI, each of the ghosts has only one possible position that ends with a "Z" on its...
New
Today’s problem is really tense. I don’t think I can do it without libgraph.
New
Other popular topics
Hello, how can I check the Phoenix version ?
Thanks !
New
Hi guys, i’m new in the Elixir world, and i have to say, that i love it!
i’m having some problem to understand anonymous functions with ...
New
Hi All,
I set a environment variables in dev.exs , like below code.
when i start server, how can i set the ${enable} value?
thanks.
d...
New
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
New
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
New
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex









