fix: very_good test doesn't like [ in file names
KyleFin opened this issue · comments
Description
very_good test fails when files have [] in their filenames (as seen in Dart Frog dynamic route files).
Steps To Reproduce
- Go to '...'
- Click on '....'
- Scroll down to '....'
- See error
Expected Behavior
A clear and concise description of what you expected to happen.
Screenshots
Additional Context
Add any other context about the problem here.
Given that this is a P1 (highest priority), anyone taking this must be ready to respond to feedback quickly to make sure it gets pushed.
Reproduced issue with minimal sample code under version 0.11.0+1
. On the other hand, flutter test
does not throw an error and succeeds.
Error log
very_good test
Running "flutter test" in /Users/alestiago/Developer/workspace/oss/issues/very_good_cli/648...
✓ Optimizing tests (97ms)
test/.test_runner.dart:9:41: Error: Expected ';' after this.
import 'widget[1]_special_test.dart' as widget[1]_special_test_dart;
^^^^^^
test/.test_runner.dart:9:47: Error: Expected a declaration, but got '['.
import 'widget[1]_special_test.dart' as widget[1]_special_test_dart;
^
test/.test_runner.dart:9:48: Error: Expected a declaration, but got '1'.
import 'widget[1]_special_test.dart' as widget[1]_special_test_dart;
^
test/.test_runner.dart:9:49: Error: Expected a declaration, but got ']'.
import 'widget[1]_special_test.dart' as widget[1]_special_test_dart;
^
test/.test_runner.dart:9:50: Error: Variables must be declared using the keywords 'const', 'final', 'var' or a type name.
Try adding the name of the type of the variable or the keyword 'var'.
import 'widget[1]_special_test.dart' as widget[1]_special_test_dart;
^^^^^^^^^^^^^^^^^^
test/.test_runner.dart:10:1: Error: Directives must appear before any declarations.
Try moving the directive before any declarations.
import 'widget_test.dart' as widget_test_dart;
^^^^^^
test/.test_runner.dart:14:45: Error: A prefix can't be used as an expression.
group('widget[1]_special_test_dart', () { widget[1]_special_test_dart.main(); });
^^^^^^
test/.test_runner.dart:14:53: Error: Expected ';' after this.
group('widget[1]_special_test_dart', () { widget[1]_special_test_dart.main(); });
^
Failed to load "/Users/alestiago/Developer/workspace/oss/issues/very_good_cli/648/test/.test_runner.dart": Compilation failed for testPath=/Users/alestiago/Developer/workspace/oss/issues/very_good_cli/648/test/.test_runner.dart
loading /Users/alestiago/Developer/workspace/oss/issues/very_good_cli/648/test/.test_runner.dart /Users/alestiago/Developer/workspace/oss/issues/very_good_cli/648/test/.test_runner.dart (FAILED)
00:00 -1: Some tests failed.
Failing Tests:
- [ERROR] ...=/Users/alestiago/Developer/workspace/oss/issues/very_good_cli/648/test/.test_runner.dart
@KyleFin the issue seems to be within the optimisation process. In the meantime you can use:
very_good test --no-optimization