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

[#1128] Refactor test framework for diagnostics #1129

Merged
merged 1 commit into from
Oct 31, 2021

Conversation

robertoaloi
Copy link
Member

Description

After this cleanup and refactoring, a typical diagnostics suite will look like:

-spec escript_warnings(config()) -> ok.
escript_warnings(_Config) ->
  Path = src_path("diagnostics_warnings.escript"),
  Source = <<"Compiler">>,
  Errors = [],
  Warnings = [ #{ code => <<"L1230">>
                , message => <<"function unused/0 is unused">>
                , range => {{23, 0}, {24, 0}}
                }
             ],
  Hints = [],
  els_test:run_diagnostics_test(Path, Source, Errors, Warnings, Hints).

Fixes #1128 .

@robertoaloi robertoaloi merged commit fe74276 into main Oct 31, 2021
@robertoaloi robertoaloi deleted the 1128-simplify-diagnostics-tests branch October 31, 2021 14:12
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.

Simplify diagnostics tests
1 participant