I am interested in a simple approach to test library private classes/functions. There are two files below meant to test code in the file curves_attribution.dart. The latter (2) is the suggested approach described in http://pub.dartlang.org/doc/package-layout.html. The downside to that is you have no access to private library scoped items. A simple solution to test library scoped items is to include tests in the library itself. The implications of this are that any includes required by (1) must be added to the library finance.dart, but they are required only for the purpose of testing. So, for example, unittest.dart would be imported.
I've tried this setup by accessing the tests successfully with http://pub.dartlang.org/packages/hop. Is it realistic to expect to be able to ship apps that have 0 testing code included due to tree-shaking?
If not suggestions for other approaches to testing library private code welcome. If this is a bad idea for other reasons, please explain.
|-- lib
| |-- finance.dart
| |-- src
| | |-- finance
| | | |-- curves_attribution.dart
| | | |-- test_curves_attribution.dart (1)
| |-- test
| | |-- test_curves_attribution_public.dart (2)