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

[Rust] Add u128 and i128 primitive types. #2002

Merged
merged 1 commit into from
Jul 30, 2019

Conversation

willstott101
Copy link
Contributor

Since rust-lang/rust#38482 Rust has had native u128 and i128 integers.

@wbond
Copy link
Member

wbond commented Jul 30, 2019

Could we add a test assertion or two to make sure we don't regress on these in the future?

@FichteFoll
Copy link
Collaborator

Personally, I find it superfluous to add tests for these kind of patterns with lots of options and where you only added one or two, because when following this argument you'd also have to have a test for every support.type identifier and that's overkill imo.

@willstott101
Copy link
Contributor Author

I could replace a few of the existing integer suffixes in the test file with 128bit suffixes.

I could add completely new tests for all suffixes.

Or perhaps via support for several occurrences of the same syntax in one comment I could make more of a matrix of supported formats.

  1i8; 1i16; 1i32; 1i64; 1i128;
//^^^  ^^^^  ^^^^  ^^^^  ^^^^^ constant.numeric.integer.decimal
// ^^   ^^^   ^^^   ^^^   ^^^^ storage.type - constant.numeric.integer.decimal

But without access to the test code I have no idea how sensible that is.

@wbond
Copy link
Member

wbond commented Jul 30, 2019

Personally, I find it superfluous to add tests for these kind of patterns with lots of options and where you only added one or two, because when following this argument you'd also have to have a test for every support.type identifier and that's overkill imo.

I think my approach is that is we missed this for a year or more and it had to be reported and fixed, it may be rare enough that someone wouldn't think to look for it.

Generally, if I see a fix with tests and it isn't complicated I can just merge. If there are no tests than more effort is spent trying to figure out why there are no tests, and if we really need them. Maybe the author hasn't spent time reading the docs for .sublime-syntax and doesn't know about the tests?

@wbond wbond merged commit 546c8d9 into sublimehq:master Jul 30, 2019
@FichteFoll
Copy link
Collaborator

I think my approach is that is we missed this for a year or more and it had to be reported and fixed, it may be rare enough that someone wouldn't think to look for it.

That's a good point, considering this is a nightly-only feature and also behind a feature flag, people aren't going to use it a whole lot. I didn't even know about these types.
My usual practice is to pick a couple examples from a pattern set like this, which should give appropriate coverage on them, but I don't have any set rules.

@Thom1729
Copy link
Collaborator

Devil's advocate: why not test every single support identifier?

mitranim pushed a commit to mitranim/Packages that referenced this pull request Mar 25, 2022
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.

4 participants