-
Notifications
You must be signed in to change notification settings - Fork 13
New features from old repo #19
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
Conversation
This commit aimed to specify a line in the undefined remote type error message. Unfortunately, the missing line was not the Elixir thing because Gradualizer cleans the location info on purpose. Well, but the mapper may be useful in the future, so why not push it. - Add spec mapper - Test spec mapper
Included changes: - Make code cleaner and better organized. - Extract functions handling tokens to new Tokens module. - Extract types to new Types module. - Rename SpecifyErlAst to AstSpecifier module. - [test] Extract helper functions to new test helper module. - [test] Add test module for tokens and move tokens tests there.
test/gradient/elixir_fmt_test.exs
Outdated
| errors = type_check_file(ast, opts) | ||
|
|
||
| for e <- errors do | ||
| :io.put_chars(e) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't assert anything in this test, do we? I think it's fine to have one or two tests that just use the expected literal binaries to assert if the formatting works as expected. Obviously, we won't do it for all possible error types, but a few are OK.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this test case needs to assert something in the future. I used it only to display some results and it is set to be skipped. Should I try to provide some real tests in this PR or do it in a new one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would be nice to have in this PR 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I will try to provide some tests then :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added tests for the cases defined in the test/examples/type/wrong_ret.ex 😃 I only check there if the error message contains the correct value. I don't want to compare the full message because the message could change in near future. Also, these checks should be later replaced with something more precise.
|
That's great!
|
Co-authored-by: Radek Szymczyszyn <radoslaw.szymczyszyn@erlang-solutions.com>
- Add top-level type for a get_conditional return. - Rename flat_tokens to flatten_tokens.
This PR adds the following features:
@spec(could be useless, so maybe should be commented),