Skip to content
This repository was archived by the owner on Apr 8, 2021. It is now read-only.

Initial code commit with basic functionality, some tests, and a README #1

Merged
merged 3 commits into from
May 23, 2017

Conversation

srawlins
Copy link
Contributor

This is the basic functionality of expected_output. It's the same functionality in use by dart_style and markdown (and others?).

@srawlins srawlins requested review from munificent and pq May 17, 2017 16:49
@srawlins
Copy link
Contributor Author

Rather than a rubber stamp approval, I'd love an actual review of, specifically, a few pieces here:

  • the README. It's kind of slap dash stream of conciousness right now.
  • naming
    • specifically, what are these data test case input/expectedOutput files? data files? test case files?
    • what about each "case", i.e. the input/expectedOutput pair? I have a class named DataCase but I just totally made this up, and I'm not married to it.
    • The API names: dataCases, dataCasesUnder. Meh?

Copy link
Contributor

@pq pq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general looks great. I'm squeamish about using mirrors but maybe I'm just being superstitious.

CONTRIBUTING.md Outdated

All files in the project must start with the following header.

// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2017?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

}

var file = p.basename(entry.path)
.replaceFirst(new RegExp('\.$extension\$'), '');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: this formatting looks odd. I'd expect something more like:

  var file =
      p.basename(entry.path).replaceFirst(new RegExp('\.$extension\$'), '');

?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or are you shying away from dartfmt?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Durp. Sorry I forgot to dartfmt 😝

library touppercase.tests;

void main() {
for (var dataCase in dataCasesUnder(library: #touppercase.tests)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the benefit in using reflection vs. specifying a data directory?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no other way to get a directory relative to the executing code. (Unless there recently is.) The mirrors incantation comes from dart-lang/test#110.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just put a little comment in the README about this.

@pq
Copy link
Contributor

pq commented May 18, 2017

the README. It's kind of slap dash stream of conciousness right now.

It's better than you think! 👍

naming
specifically, what are these data test case input/expectedOutput files? data files? test case files?

I take this to be an implementation detail so wouldn't sweat it too much.

what about each "case", i.e. the input/expectedOutput pair? I have a class named DataCase but I > just totally made this up, and I'm not married to it.

Same. @munificent may have some more thoughts here since it's been a while since I wrote any tests this way --- though now that I see it again, you've got me thinking! 😉

The API names: dataCases, dataCasesUnder. Meh?

Hmmmm. As I mentioned, I'm curious about the decision to reflect rather than just specify directories. If mirrors is the way to go though I think dataCases ain't bad.

@srawlins
Copy link
Contributor Author

@munificent, not urgent, but I'll wait a day or two in case you want to put in some input on naming. I'd rather fix it sooner than later if you hate the names or the API.

Copy link

@munificent munificent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks nice! 👍

@srawlins
Copy link
Contributor Author

Thanks @pq and @munificent !

@srawlins srawlins merged commit 114a50b into dart-archive:master May 23, 2017
@srawlins srawlins deleted the basic-functionality branch May 23, 2017 03:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants