Commit Graph

106 Commits

Author SHA1 Message Date
turnidge@google.com 1da7c97936 A round of edits to make mirrors.dart more like our current working
proposal.
Review URL: https://chromiumcodereview.appspot.com//10854197

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10918 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-17 19:56:50 +00:00
dgrove@google.com de531b234a Move args from lib/ to pkg/ .
Review URL: https://chromiumcodereview.appspot.com//10831371

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10910 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-17 17:57:10 +00:00
gram@google.com 40ba5f137d Added the ability to get the names of the options in a set of parsed arguments, and the default value for an argument. These are useful so we can see what the user has explicitly set that is non-default behavior.
Review URL: https://chromiumcodereview.appspot.com//10828351

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10904 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-17 17:07:51 +00:00
alanknight@google.com 3122c09799 Move status file entries from tests/lib to pkg so as not to run known failing tests on the moved li…
Review URL: https://chromiumcodereview.appspot.com//10836272

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10772 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-15 22:02:27 +00:00
alanknight@google.com 2e5ddeab23 Move unittest tests underneath it in /pkg
Review URL: https://chromiumcodereview.appspot.com//10823332

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10770 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-15 21:12:43 +00:00
dgrove@google.com 747b22d3bc Move fixnum to from lib/ to pkg/ . Once pub.dartlang.org
is available, this package will likely be moved there.
Review URL: https://chromiumcodereview.appspot.com//10854162

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10769 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-15 20:33:16 +00:00
alanknight@google.com ce28be9d2f Move tests for things in /pkg into the right places for packages
Review URL: https://chromiumcodereview.appspot.com//10828310

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10688 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-14 23:05:20 +00:00
dgrove@google.com c265902bea Move unittest from lib to pkg.
Review URL: https://chromiumcodereview.appspot.com//10836241

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10685 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-14 22:36:59 +00:00
dgrove@google.com 8998e74536 Start moving non-platform libraries from lib/ to pkg/ .
Review URL: https://chromiumcodereview.appspot.com//10827227

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10655 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-14 16:26:41 +00:00
gram@google.com 8f4acb858a Add support for upper case in arguments.
Review URL: https://chromiumcodereview.appspot.com//10854133

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10607 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-13 21:52:54 +00:00
gram@google.com 31cfa3d5d4 Added ability to reset Mocks.
Review URL: https://chromiumcodereview.appspot.com//10855128

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10588 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-13 17:29:38 +00:00
efortuna@google.com 1d14fb856e Un-enable Opera.
Review URL: https://chromiumcodereview.appspot.com//10826255

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10543 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-10 23:36:51 +00:00
efortuna@google.com 5072b18d98 Enable Opera testing (!!!).
Review URL: https://chromiumcodereview.appspot.com//10832239

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10513 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-10 16:50:34 +00:00
gram@google.com 7186d947b6 Added support for multi-valued options (options that can occur more than once).
Review URL: https://chromiumcodereview.appspot.com//10855084

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10477 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-10 00:43:35 +00:00
alanknight@google.com 25179dc195 Date formatting with another dartj2s workaround
Review URL: https://chromiumcodereview.appspot.com//10830246

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10454 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-09 20:06:05 +00:00
alanknight@google.com 59dd96e9bb git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10427 260f80e4-7a28-3924-810f-c04153c831b5 2012-08-09 00:41:47 +00:00
alanknight@google.com 3041e7fafc Date formatting again with fixes
Does not import intl.dart twice, and does not attempt to directly sort the keys of a map, which dartj2s does not like (issue 4421).
Review URL: https://chromiumcodereview.appspot.com//10826216

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10426 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-09 00:20:55 +00:00
efortuna@google.com 875922a1a6 Revert 10419-10420.
Review URL: https://chromiumcodereview.appspot.com//10854051

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10422 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-08 21:37:36 +00:00
alanknight@google.com f4a666d87e Fixes from adding date formatting
Review URL: https://chromiumcodereview.appspot.com//10834235

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10420 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-08 20:56:23 +00:00
alanknight@google.com 983721802b Add date formatting and parsing code.
Review URL: https://chromiumcodereview.appspot.com//10807096

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10419 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-08 20:37:51 +00:00
gram@google.com 02df7ce4f6 Mark negative test as fail for dartc.
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10364 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-08 02:11:26 +00:00
gram@google.com 3c64ea372c Added the ability to tun off logging for individual behaviors.
Added stepwise validation support.
Review URL: https://chromiumcodereview.appspot.com//10827201

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10363 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-08 00:50:00 +00:00
rnystrom@google.com 0bc9b19740 Rename BadNumberFormatException -> FormatException.
Review URL: https://chromiumcodereview.appspot.com//10850034

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10354 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-07 20:56:59 +00:00
gram@google.com 2edb59744d Remove use of deprecated test functions.
Review URL: https://chromiumcodereview.appspot.com//10828139

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10238 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-03 16:51:21 +00:00
gram@google.com e616d2b386 Ability to guard callbacks that may never get called (protectAsync*), and simplified and improved handling of exceptions.
Review URL: https://chromiumcodereview.appspot.com//10830128

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10152 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-02 00:42:53 +00:00
gram@google.com a4b01c388e Fix issue 4227 - unittest.dart silently consumes exceptions when expectAsync is active.
Review URL: https://chromiumcodereview.appspot.com//10834098

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10103 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-01 01:00:32 +00:00
gram@google.com 547b8c0055 Added bad regexp callmatcher mock test.
Review URL: https://chromiumcodereview.appspot.com//10826086

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10088 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-31 21:29:59 +00:00
gram@google.com 27846b0846 Improved the way we generate mismatch descriptions.
matches() methods can now return additional state that is used by describeMismatch(). This adds a small tax to the happy path, but makes the unhappy path quite a bit more efficient as well as providing better error messages.

Related to this, expect() can now be passed a verbose flag. Currently this is used by throwsA/returnsNormally to provide stack traces from the actual exception but could be used for other things too.

The tests for the Mock classes have been changed to be normal tests, not 'meta' tests. 

A couple of other minor fixes.
Review URL: https://chromiumcodereview.appspot.com//10832058

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10078 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-31 18:12:49 +00:00
rmacnak@google.com 2353835d5b Added InterfaceMirror.newInstance().
Review URL: https://chromiumcodereview.appspot.com//10834056

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10020 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-30 17:48:47 +00:00
smok@google.com 4412f8653f dart2dart Skip non-language tests, leave yaml too.
Review URL: https://chromiumcodereview.appspot.com//10823079

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10014 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-30 13:50:54 +00:00
smok@google.com ac8d991870 dart2dart
Several fixes for more robust renaming of type annotations and Send-s:
Correct renaming of class interfaces with type arguments, renaming
of global functions, constructor and named constructor calls, static
field accesses.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10003 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-30 05:27:58 +00:00
antonm@google.com 74d17a16f9 dart2dart compiler support.
R=whesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9880 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-25 11:20:41 +00:00
rmacnak@google.com 99ad7f4170 Added ClosureMirror to dart:mirrors. Added Dart_ClosureFunction to the
embedding API. ClosureMirrors currently implement answering the closure's
function and applying the closure.
Review URL: https://chromiumcodereview.appspot.com//10800065

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9860 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-24 17:59:12 +00:00
rmacnak@google.com bf0005b70a The mirror tests made the invalid assumption that the library with the tests
will be the root library at run time. They should instead get the library
mirror by name.
Review URL: https://chromiumcodereview.appspot.com//10805085

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9858 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-24 17:22:50 +00:00
rmacnak@google.com a81ee512b7 Disable mirror tests on Dartium to fix the build. TBR.
Review URL: https://chromiumcodereview.appspot.com//10815067

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9833 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-23 23:42:52 +00:00
rmacnak@google.com e0931044c0 Added getField/setField to ObjectMirror. For InstanceMirrors, this get/sets
fields; for InterfaceMirrors, static fields; for LibraryMirrors, top-level 
fields.
Review URL: https://chromiumcodereview.appspot.com//10704259

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9832 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-23 22:53:52 +00:00
gram@google.com f4a97b587b Temporal assertion support.
Review URL: https://chromiumcodereview.appspot.com//10804014

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9769 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-19 20:13:01 +00:00
iposva@google.com b7ea8b66ed - Use #library when using imports in tests.
Review URL: https://chromiumcodereview.appspot.com//10802023

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9749 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-18 22:03:52 +00:00
iposva@google.com 4494da7b1a - Add basic math tests from math_test.dart, but using dart:math.
Review URL: https://chromiumcodereview.appspot.com//10797015

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9745 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-18 20:53:11 +00:00
gram@google.com dc00274a1f Fix the weird names that can occur in exceptions and logs when there is no
mock qualifier and due to the method names getting wrapped in quotes.

To help this work properly, we now assert that a Mock has a name if it is 
passed in a LogEntryList, as opposed to allocating its own. We already said
in the comments that this was a requirement but it wasn't enforced. 
Review URL: https://chromiumcodereview.appspot.com//10702177

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9613 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-12 21:02:44 +00:00
gram@google.com e75fb92bcb Added ability to disable logging in mocks, to avoid the memory overhead if you don't need behavior verification of the mock itself.
Changed exceptions to end with periods - seems more Darty.
Review URL: https://chromiumcodereview.appspot.com//10694146

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9575 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-11 23:32:23 +00:00
gram@google.com b0e10499c3 CallMatchers can now be null, or take null for a method name. This might be
useful if we want to do things like find all method calls that returned a 
certain value.
Review URL: https://chromiumcodereview.appspot.com//10689148

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9570 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-11 19:57:52 +00:00
gram@google.com 2c125a4cd2 Mocking library improvements:
- Timestamped logs
- Using enum pattern
- Improved verifiers

This is basically the same as the last reverted change but has a few bug fixes 
and now uses the enum pattern.
Review URL: https://chromiumcodereview.appspot.com//10752007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9489 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-09 22:41:17 +00:00
nweiz@google.com cefb44c63e Have Pub make use of the arg parser.
Also allow non-negatable flags in the arg parser.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9488 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-09 22:13:24 +00:00
dgrove@google.com 01673db5bc Revert 9275 due to broken build.
Review URL: https://chromiumcodereview.appspot.com//10693057

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9277 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-30 06:32:31 +00:00
gram@google.com 142b8a5115 Some more changes that came out of writing an article on mocks.
- wrap the matchers in anyOf/allOf
- add timestamps to log entries
- add ability to share logs
- changed 'called' to 'happened'; it scans better and makes more sense in throw cases
- added ability to pass an action matcher to getLogs
- moved getLogs back into Mock
Review URL: https://chromiumcodereview.appspot.com//10692051

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9275 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-30 00:13:38 +00:00
sigmund@google.com da172b319c first version of a logging library.
Review URL: https://chromiumcodereview.appspot.com//10693042

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9269 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-29 21:27:01 +00:00
efortuna@google.com 5d47896e05 Get rid of BidiUtils as a class holding only static methods. I was reminded by
this dart style quiz (third slide:
http://data-prez.appspot.com/deck/id=agtzfmRhdGEtcHJlenIRCxIJU2xpZGVEZWNrGKm6BAw&slide=2?locale=en).
Review URL: https://chromiumcodereview.appspot.com//10703030

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9222 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-28 20:56:26 +00:00
gram@google.com 214ffb65dd Test fix.
Review URL: https://chromiumcodereview.appspot.com//10697019

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9215 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-28 18:41:46 +00:00
gram@google.com 255414825a Changed the syntax some. All the handling of variable argument lists is
moved to a function callsTo(), and when() is renamed whenThereAre(), so we
write m.whenThereAre(callsTo(...)).

Verification is moved out of Mock; Mock just returns the matching log, and 
LogEntrySet verify() is used instead.

Added the ability to proxy calls, so we can create spys.

Added the ability to verify return values.

Added some tests.
Review URL: https://chromiumcodereview.appspot.com//10718002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9212 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-28 18:16:53 +00:00