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

doctest raises syntaxerror: unexpected token #11291

Closed
ggscha opened this issue Oct 5, 2021 · 0 comments
Closed

doctest raises syntaxerror: unexpected token #11291

ggscha opened this issue Oct 5, 2021 · 0 comments

Comments

@ggscha
Copy link

ggscha commented Oct 5, 2021

Environment

  • Elixir & Erlang/OTP versions (elixir --version): Elixir 1.12.3 (compiled with Erlang/OTP 22)
  • Operating system: Windows 10
  • IDE: VSCode

Current behavior

As a newy to Elixir I walked through the provided example on the official web page. Regarding doctest I got following output:

  6) doctest KVServer.Command.parse/1 (1) (KVServer.CommandTest)
     test/command_test.exs:3
" (column 46, code point U+000D)t: (SyntaxError) lib/command.ex:7:46: unexpected token: "
     doctest:
       iex> KVServer.Command.parse "CREATE shopping\r\n"
       {:ok, {:create, "shopping"}}
     stacktrace:
       lib/command.ex:7: KVServer.Command (module)

Expected behavior

the test cases generated by doctest should have been smoothly executed without error.

Temporary resolution

It looks like as if doctest does not recognize properly EOL if going with the OS/IDE-defaults (CRLF in this case). Switching to LF for the concerned source files resolves the issue for the time being.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant