Skip to content

Commit b0b04ce

Browse files
committed
Start iterator with empty string
1 parent 27dc4ca commit b0b04ce

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

lib/elixir_analyzer.ex

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,10 +253,9 @@ defmodule ElixirAnalyzer do
253253
defp read_files(paths) do
254254
Enum.reduce_while(
255255
paths,
256-
{:ok, nil},
256+
{:ok, ""},
257257
fn path, {:ok, code} ->
258258
case File.read(path) do
259-
{:ok, file} when is_nil(code) -> {:cont, {:ok, file}}
260259
{:ok, file} -> {:cont, {:ok, code <> "\n" <> file}}
261260
{:error, err} -> {:halt, {:error, err}}
262261
end

test/elixir_analyzer/cli_test.exs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ defmodule ElixirAnalyzer.CLITest do
2828
halted: false,
2929
source: %Source{
3030
code_ast: {:defmodule, _, _},
31-
code_string: "defmodule Lasagna" <> _,
31+
code_string: "\ndefmodule Lasagna" <> _,
3232
submitted_files: [@lasagna_path <> "/lib/lasagna.ex"],
3333
exemploid_ast: {:defmodule, _, _},
34-
exemploid_string: "defmodule Lasagna" <> _,
34+
exemploid_string: "\ndefmodule Lasagna" <> _,
3535
exemploid_files: [@lasagna_path <> "/.meta/exemplar.ex"],
3636
exercise_type: :concept,
3737
path: @lasagna_path,

0 commit comments

Comments
 (0)