dart-lang / sdk

The Dart SDK, including the VM, dart2js, core libraries, and more.
https://dart.dev
BSD 3-Clause "New" or "Revised" License
9.95k stars 1.53k forks source link

[analyzer/ffi] Add tests executing ffi_verifier.dart #44773

Open dcharkes opened 3 years ago

dcharkes commented 3 years ago

We should add tests that exercise ffi_verifier.dart during various actions the dartanalyzer can do besides analyzing.

That way we might prevent issues such as https://github.com/dart-lang/sdk/issues/44763 in the future.

(How about fuzzing?)

@srawlins @scheglov Currently we only have analyzer tests for warnings/errors that are ffi-specific. Where do I add tests for code completion and hover? And do we have non-ffi analyzer tests for these actions that I can take inspiration from?

For reference:

There are test called completion/complete, but they are outside pkg/analyzer.

scheglov commented 3 years ago

It is not code completion and hover per se that should be tested. We see exceptions there because it is the nature of Dart Analysis Server to work with incomplete and invalid code - some identifiers might be unresolved because the user has not finished typing them yet. So, the goal here should be to verify that FFI tests have necessary invalid code cases that cover places where something might be unresolved.