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

fixes #132 #133

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kylewhite21
Copy link

I added another arg to parse_to_end that compares the prior sequence passed to the current sequence, and if they are the same then the stream halts with StrayEscapeCharacterError.

I'm not sure if that covers all edge cases, but all tests pass including the error from #132.

I added another test to check for this scenario.

@kylewhite21
Copy link
Author

FWIW dialyzer passed for me locally

> vc/kylewhite21/csv bugfix/infinite-loop-on-unclosed-esc % mix dialyzer
Finding suitable PLTs
Checking PLT...
[:compiler, :elixir, :kernel, :mnesia, :stdlib]
Looking up modules in dialyzer.plt
Looking up modules in dialyxir_erlang-25.3.2_elixir-1.15.4.plt
Finding applications for dialyxir_erlang-25.3.2_elixir-1.15.4.plt
Finding modules for dialyxir_erlang-25.3.2_elixir-1.15.4.plt
Removing 5 modules from dialyxir_erlang-25.3.2_elixir-1.15.4.plt
Checking 453 modules in dialyxir_erlang-25.3.2_elixir-1.15.4.plt
Adding 5 modules to dialyxir_erlang-25.3.2_elixir-1.15.4.plt
done in 0m12.48s
Finding applications for dialyzer.plt
Unknown application :mnesia
Finding modules for dialyzer.plt
Copying dialyxir_erlang-25.3.2_elixir-1.15.4.plt to dialyzer.plt
Looking up modules in dialyzer.plt
Checking 458 modules in dialyzer.plt
Adding 56 modules to dialyzer.plt
done in 0m29.06s
No :ignore_warnings opt specified in mix.exs and default does not exist.

Starting Dialyzer
[
  check_plt: false,
  init_plt: ~c"/Users/kwhite/vc/kylewhite21/csv/priv/plts/dialyzer.plt",
  files: [~c"_build/test/lib/csv/ebin/Elixir.CSV.Decoding.Decoder.beam",
   ~c"_build/test/lib/csv/ebin/Elixir.CSV.Decoding.Parser.beam",
   ~c"_build/test/lib/csv/ebin/Elixir.CSV.Defaults.beam",
   ~c"_build/test/lib/csv/ebin/Elixir.CSV.Encode.Any.beam",
   ~c"_build/test/lib/csv/ebin/Elixir.CSV.Encode.BitString.beam", ...],
  warnings: [:unmatched_returns, :error_handling, :no_opaque, :underspecs, ...]
]
Total errors: 0, Skipped: 0, Unnecessary Skips: 0
done in 0m0.55s
done (passed successfully)

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

Successfully merging this pull request may close these issues.

1 participant