From 9fd82df81692b1f7ed7a033574ba0117e74005e4 Mon Sep 17 00:00:00 2001 From: Michael berkowitz Date: Wed, 30 Apr 2025 14:43:52 -0400 Subject: [PATCH] Write the first output to `:stderr` otherwise it causes the first test to fail --- compiled_starters/elixir/lib/main.ex | 2 +- solutions/elixir/01-ry8/diff/lib/main.ex.diff | 2 +- starter_templates/elixir/code/lib/main.ex | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/compiled_starters/elixir/lib/main.ex b/compiled_starters/elixir/lib/main.ex index 0df1adf..ae054a8 100644 --- a/compiled_starters/elixir/lib/main.ex +++ b/compiled_starters/elixir/lib/main.ex @@ -4,7 +4,7 @@ defmodule CLI do case args do ["tokenize", filename] -> # You can use print statements as follows for debugging, they'll be visible when running tests. - IO.puts("Logs from your program will appear here!") + IO.puts(:stderr, "Logs from your program will appear here!") case File.read(filename) do {:ok, file_contents} -> diff --git a/solutions/elixir/01-ry8/diff/lib/main.ex.diff b/solutions/elixir/01-ry8/diff/lib/main.ex.diff index a77a1cf..cf643f9 100644 --- a/solutions/elixir/01-ry8/diff/lib/main.ex.diff +++ b/solutions/elixir/01-ry8/diff/lib/main.ex.diff @@ -5,7 +5,7 @@ case args do ["tokenize", filename] -> - # You can use print statements as follows for debugging, they'll be visible when running tests. -- IO.puts("Logs from your program will appear here!") +- IO.puts(:stderr, "Logs from your program will appear here!") - case File.read(filename) do {:ok, file_contents} -> diff --git a/starter_templates/elixir/code/lib/main.ex b/starter_templates/elixir/code/lib/main.ex index 0df1adf..ae054a8 100644 --- a/starter_templates/elixir/code/lib/main.ex +++ b/starter_templates/elixir/code/lib/main.ex @@ -4,7 +4,7 @@ defmodule CLI do case args do ["tokenize", filename] -> # You can use print statements as follows for debugging, they'll be visible when running tests. - IO.puts("Logs from your program will appear here!") + IO.puts(:stderr, "Logs from your program will appear here!") case File.read(filename) do {:ok, file_contents} ->