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

fix: very_good test doesn't like [ in file names #648

Closed
KyleFin opened this issue Feb 10, 2023 · 3 comments · Fixed by #658
Closed

fix: very_good test doesn't like [ in file names #648

KyleFin opened this issue Feb 10, 2023 · 3 comments · Fixed by #658
Assignees
Labels
bug Something isn't working as expected good first issue Good for newcomers

Comments

@KyleFin
Copy link
Contributor

KyleFin commented Feb 10, 2023

Description
very_good test fails when files have [] in their filenames (as seen in Dart Frog dynamic route files).

Steps To Reproduce

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected Behavior
A clear and concise description of what you expected to happen.

Screenshots

image

Additional Context
Add any other context about the problem here.

@KyleFin KyleFin added the bug Something isn't working as expected label Feb 10, 2023
@BeatriceMitchell BeatriceMitchell added the good first issue Good for newcomers label Feb 13, 2023
@BeatriceMitchell
Copy link

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.

@alestiago alestiago self-assigned this Feb 20, 2023
@alestiago alestiago added waiting for response Waiting for follow up and removed waiting for response Waiting for follow up labels Feb 20, 2023
@alestiago
Copy link
Contributor

alestiago commented Feb 20, 2023

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

@alestiago
Copy link
Contributor

alestiago commented Feb 20, 2023

@KyleFin the issue seems to be within the optimisation process. In the meantime you can use:

very_good test --no-optimization

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as expected good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants