Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Issue 10871008: Add a number of convenience methods to test_pub. (Closed)

Created:
8 years, 4 months ago by nweiz
Modified:
8 years, 4 months ago
Reviewers:
Bob Nystrom
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Add a number of convenience methods to test_pub. This changelist has two goals. The first is to simply clean up pub_test by factoring out repeated patterns, removing the use of raw YAML, and making the commands more semantic. The second goal is to set the stage for the use of ephemeral ports for the mock package server, which will allow multiple instances of the tests to be run simultaneously. Committed: https://code.google.com/p/dart/source/detail?r=11261

Patch Set 1 #

Total comments: 8

Patch Set 2 : Code review changes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+371 lines, -823 lines) Patch
M utils/tests/pub/pub_test.dart View 26 chunks +177 lines, -800 lines 0 comments Download
M utils/tests/pub/test_pub.dart View 1 5 chunks +194 lines, -23 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
nweiz
8 years, 4 months ago (2012-08-22 00:50:59 UTC) #1
Bob Nystrom
This is really nice. LGTM. One thing we should talk about at some point: Unit ...
8 years, 4 months ago (2012-08-22 16:33:09 UTC) #2
nweiz
8 years, 4 months ago (2012-08-23 18:09:08 UTC) #3
https://chromiumcodereview.appspot.com/10871008/diff/1/utils/tests/pub/test_p...
File utils/tests/pub/test_pub.dart (right):

https://chromiumcodereview.appspot.com/10871008/diff/1/utils/tests/pub/test_p...
utils/tests/pub/test_pub.dart:133: pubspecs.forEach((spec) {
On 2012/08/22 16:33:09, Bob Nystrom wrote:
> This is mostly a matter of taste, but how about using a regular for-in loop
> here? I tend to only use forEach() for maps, or if the body actually needs to
be
> a first class function. Otherwise, especially with multi-line bodies, I think
a
> regular loop is a bit easier to read and more familiar to most programmers.

Done.

https://chromiumcodereview.appspot.com/10871008/diff/1/utils/tests/pub/test_p...
utils/tests/pub/test_pub.dart:164: * Returns a file named `pubspec.yaml` with
the given YAML-serialized
On 2012/08/22 16:33:09, Bob Nystrom wrote:
> I find the "Returns a" and "Returns the" (especially the latter) a bit
confusing
> to read. For example "Returns the `packages/` directory containing all the
given
> [packages]" makes it sound like the packages/ dir already exists and the
> function just finds it.
> 
> How about "Describes a" instead?

Done.

https://chromiumcodereview.appspot.com/10871008/diff/1/utils/tests/pub/test_p...
utils/tests/pub/test_pub.dart:954: * Completes with the fully resolved
structure.
On 2012/08/22 16:33:09, Bob Nystrom wrote:
> This is very cool, although it pains me to realize Dart's async model means
> we're apparently very slowly reinventing Haskell, one thunk at a time.

Yyyyep.

https://chromiumcodereview.appspot.com/10871008/diff/1/utils/tests/pub/test_p...
utils/tests/pub/test_pub.dart:957: if (object is Future) return
object.chain(_awaitObject);
On 2012/08/22 16:33:09, Bob Nystrom wrote:
> Took me a while to realize what this case was for. Add:
> 
> // Unroll nested futures.

Done.

Powered by Google App Engine
This is Rietveld 408576698