Commit Graph

15 Commits

Author SHA1 Message Date
Erik Ernst 40b6741778 Adds support for syntax error in tests to test.py.
This CL modifies the Dart source used from test.py such that it takes
`syntax error` into account as an expected outcome in test files (so
that we can have `//# 01: syntax error` with a similar meaning as
`//# 01: compile-time error`).

For all tools except the spec_parser, `syntax error` is the same
outcome as `compile-time error`; that is, nobody else will see the
difference.

For the spec_parser, `syntax error` is the outcome where parsing has
failed; `compile-time error` is taken to mean some other compile-time
error, i.e., the spec_parser is expected to _succeed_ when the
expected outcome is `compile-time error`.

Test files in language and language_2 have been adjusted to use the
outcome `syntax error` where appropriate.

The status files in language and language_2 for the spec_parser have
been adjusted such that they fit all the new `syntax error` outcomes
in test files.

Other status files have been adjusted in a few cases where tests were
corrected (because a compile-time error which was clearly not intended
to be a syntax error turned out to be caused by a typo, which means
that the actual compile-time error has never been tested).

The spec grammar Dart.g was adjusted in a few cases, when some bugs
were discovered. In particular, the treatment of Function has been
changed: It is now known by the parser that Function does not take
any type arguments. This makes no difference for developers, because
they cannot declare a type named Function anyway, but it means that
a number of tricky parsing issues were resolved.

Dart.g was also adjusted to allow `qualified` to contain three
identifiers, which is an old bug (preventing things like metadata on
the form `@p.C.myConst`).

Change-Id: Ie420887d45c882ef97c84143365219f8aa0d2933
Reviewed-on: https://dart-review.googlesource.com/18262
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2017-11-06 08:56:09 +00:00
Jacob Richman 14531fa62d Re-land "Format all multitests"
Only delta from the original is a bad merge of tests/corelib/list_test.dart

This reverts commit 44d8be0ed3.

BUG=

Review-Url: https://codereview.chromium.org/2774783002 .
2017-03-23 12:40:21 -07:00
Jacob Richman 44d8be0ed3 Revert "Format all multitests"
This reverts commit 312b66dd5f.

BUG=

Review-Url: https://codereview.chromium.org/2770063002 .
2017-03-23 10:49:40 -07:00
Jacob Richman 312b66dd5f Format all multitests
BUG=
R=rnystrom@google.com

Review-Url: https://codereview.chromium.org/2768073002 .
2017-03-23 10:26:44 -07:00
Jacob Richman 88eb557b65 Fix warnings_checker.dart handling of multitests
Update all tests

Support //# multitests for better dartfmt compatibility and fewer multitest false positives

All files under tests were manually updated with

find . -iregex '.*\.dart$' -print0 | xargs -0 perl -pi -e 's/(\S\s+)\/\/\/ /$1\/\/# /'

For now both old and new styles are allowed to accommodate CO19 tests.

R=efortuna@google.com
BUG=

Review-Url: https://codereview.chromium.org/2765693002 .
Review-Url: https://codereview.chromium.org/2765893003 .
2017-03-21 17:29:56 -07:00
Jacob Richman bf2b545150 Revert "Update all tests"
This reverts commit ce76e9c30beaf9a193d3677b88c20a1ebb3fae8c.
2017-03-21 16:33:18 -07:00
Jacob Richman 3c7353d987 Update all tests
Support //# multitests for better dartfmt compatibility and fewer multitest false positives

All files under tests were manually updated with

find . -iregex '.*\.dart$' -print0 | xargs -0 perl -pi -e 's/(\S\s+)\/\/\/ /$1\/\/# /'

For now both old and new styles are allowed to accommodate CO19 tests.

R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2765693002 .
2017-03-21 12:39:28 -07:00
Jacob Richman 6a7d6c385e Add comments
Add spaces to make sure dartfmt doesn't destroy bespoke indentation

BUG=
R=sra@google.com

Review-Url: https://codereview.chromium.org/2763823002 .
2017-03-20 21:03:12 -07:00
johnniwinther@google.com 7ef82b92ad Fix async_test problems.
+ disallow async modifier on setters.

BUG=
R=sigurdm@google.com

Review URL: https://codereview.chromium.org//898703004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43465 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-04 12:41:49 +00:00
paulberry@google.com b40a5702b3 Fix async/await type checking in analyzer.
This required making the "async" library into TypeProvider so that we
can create Future<...> types when doing resolution and error/hint
checking.

BUG=21888,22053,22091,22092,22160,22164
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//898513002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43361 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-02 20:58:37 +00:00
sigurdm@google.com bc8a7faf62 Fix status files to allow async-await tests to run on non-vm
Also fix a syntax-error in one test to make the analyzer happy.
BUG=
R=johnniwinther@google.com

Review URL: https://codereview.chromium.org//847123002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42858 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-14 11:07:35 +00:00
hausner@google.com bb1ab60dc0 First step in eliminating —enable_async flag
Switch default value of enable-async to true, and remove the flag
from test source code.

Next step is to remove the flag altogether

R=iposva@google.com

Review URL: https://codereview.chromium.org//814343004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42670 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-07 19:42:59 +00:00
mlippautz@google.com 47c8f8b3e2 Reland transformation of async functions.
Reland https://codereview.chromium.org/362153002/

Additions:
 * Fixes for parsing async "keyword".
 * Further tests.

BUG=
R=hausner@google.com

Review URL: https://codereview.chromium.org//423213005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38715 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-29 23:50:33 +00:00
mlippautz@google.com be3e426f27 Revert async changes.
Revert "Transform functions marked as async"
This reverts commit 79cbaaf60143babcb29bb0ed74a0da87fd998c39.

Revert "Fix snapshot test"
This reverts commit ee892aa105daccc74c734eb18934814b76a415bb.

BUG=

Review URL: https://codereview.chromium.org//428993002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38690 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-29 18:42:53 +00:00
mlippautz@google.com dfc33496a4 Transform functions marked as async
In a nutshell:

  foo(params) async { <body> return result; }

transforms to

  foo(params) async {
    var c = new Completer();
    var async_body = () { <body> completer.complete(result); }
    new Future(async_body);
    return c.future;
  }

BUG=
R=hausner@google.com

Review URL: https://codereview.chromium.org//362153002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38681 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-29 17:16:00 +00:00