Commit Graph

7 Commits

Author SHA1 Message Date
Jacob Richman 2dcd56ef43 Format all tests.
There are far too many files here to review everyone carefully.
Spot checking most of the diffs look good as test code is generally written
with less care than application code so lots of ugly formatting get through.
If people notice files where the automated formatting bothers them feel free
to comment indicating file names and I'll move spaces within comments to make
the formatting cleaner and use comments to force block formatting as I have
done for other case where formatting looked bad.

BUG=
R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2771453003 .
2017-04-17 14:53:02 -07:00
floitsch@google.com 8fd6d0aafd Remove Expect from core library.
Committed: https://code.google.com/p/dart/source/detail?r=19755
Reverted: http://code.google.com/p/dart/source/detail?r=19756

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20996 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-05 19:43:16 +00:00
floitsch@google.com 5dc8107c53 Revert "Remove Expect from core library."
This reverts commit 19755.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19756 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-09 03:19:07 +00:00
floitsch@google.com 12dbd2fd70 Remove Expect from core library.
Review URL: https://codereview.chromium.org//12212016

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19755 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-09 02:40:37 +00:00
lrn@google.com 51bc6c6479 Change switch to give warnings when cases don't follow the newest syntax.
The current implementation still falls back on if-else-if dispatch if
the case expressions are not compile-time constants. It also falls back
if the expressions fail to follow the specification for any other reason.

The specification requires that case expressions:
- Are compile-time constants.
- All have the same type and are instances of the same class.
- Do not override Object.operator==.
For the last one, I've made exceptions for int/double/String.

Function constants are rejected due to overriding operator==.
I'm not sure they do yet, but they will eventually.

Map and List are accepted. All constant Map/List instances are
expected to be instances of the same class. If we later decide to make
them override operator==, we'll have to reject them too. If we decide
to have a special class for some List/Map constants, we'll let it
override runtimeType to hide it.

Type equality is only checked as far as the constants know their type.
Type parameters are not included in the test since I don't think they
are recorded in the compile-time constant (I could be wrong).

The new switch semantics are still on "hold", so this change retains
the old version too (which accepted any expression). When we want to
remove that, it's a matter of making the warnings into errors and
remove the fallback (the current content of visitSwitchStatement after
the call to tryBuildConstantSwitch).

The validation of switch cases should really happen during resolution
if possible. I'll try to figure out how to move it there in a later
CL.

Review URL: https://chromiumcodereview.appspot.com//10916002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12189 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-11 12:26:41 +00:00
scheglov@google.com c88461077a Issue 3528. Additional checks for 'case expressions'
http://code.google.com/p/dart/issues/detail?id=3528

R=brianwilkerson@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//10540114

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8573 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-12 20:21:34 +00:00
sigmund@google.com 64d7bc5acf test rename overhaul: step 8 - language tests
Review URL: https://chromiumcodereview.appspot.com//10248007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7101 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-27 18:45:10 +00:00